{"_id": "mEeFcTJbwrNeGcis9", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.+Tutors) implies some (p.+Tutors & Teacher)\n}", "derivationOf": "YFhiPnhRd8zL5w96P", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 08:46:37"} {"_id": "NjwxgPthhrphxbBQj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (Teacher->c) implies some Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4BsSGWBcGTuHy4r3Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:59:48"} {"_id": "BZyNJDQPLaF7MrmZa", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no (Class - (Groups.(s->g))) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K7oxSApQqmHnGoiE7", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:34:22"} {"_id": "fjRYA54d47fnhWnqc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (Teacher->Teacher) & ~Teaches.Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AjgKhz2tHe7JpKAaA", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:44:54"} {"_id": "Bj4RgXRHgwpGfopKQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ne2zR2C7Prtn9PaE9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-19 18:09:38"} {"_id": "qDCabcF8Ej5YZhYbN", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:03:39"} {"_id": "tXED5dMpjjXS2AbTF", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Techer | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DMbpgEm4d6yipquba", "msg": "The name \"Techer\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 23:28:49"} {"_id": "dkQqEtYhyi7GE6c5G", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mjf3EBdBfWfhC3xaf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:37:56"} {"_id": "2GaQpuaasSY3JcgwE", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "Fd8aTxfZap4HebWf6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:58:00"} {"_id": "YrDwK68GcSzTWtcQj", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = Student + Teacher\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v9e65mvREm6AQFybc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:27:37"} {"_id": "NjDDgHNrD88K4rukS", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qpj6dSZzffmcRZZQi", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:50:13"} {"_id": "SJDuLLsdS6K6hHNa9", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Teacher and Tutors.Person in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CLoJXqpEAKQr3Dpt7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:08:44"} {"_id": "kniabvfKCteXs7ceL", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some ~Teaches&Teacher.Groups & some Group in Class\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GzMoHiYKpNroyFw68", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:08:17"} {"_id": "8PNQNgQkRNSi24vBg", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NBCD7XswDd846zbzm", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:37:47"} {"_id": "ajRjcW5eatfZWMfQS", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some c.Groups implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KPN7ZdCtHtzhW5sde", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:11:15"} {"_id": "gnrWoRMgXGQPrJ3xi", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "prAWhg2JGGDquwRuR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:57:49"} {"_id": "Tspnihr4MJ55XEZd5", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.+Tutors) in Teacher \n}", "derivationOf": "T7acgqjTpuL8gx4Aq", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:13:05"} {"_id": "Gfwdq4yzHFRsFznrb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ynYFNZieZbhRu5mCw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:48:25"} {"_id": "9w7FwedcCJaioxCQf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "synqvKAzK4SjtoT3p", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:18:41"} {"_id": "tXo4FabuGutRNeXfA", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yQErHEhebMxpABzNd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:02:53"} {"_id": "fTyFxaeoXAuvtYdPz", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-10 13:18:24"} {"_id": "9FExXDTwDtpc9a6SY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7oHPndphvBWZEZ9X5", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:23:48"} {"_id": "sCTziLwbfKKHkgwbf", "cmd_i": 0, "code": "sig Name, Adrr {}\nsig Book {\n addr: Name -> Addr\n }", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"Addr\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:25:12"} {"_id": "BwTFge6jsiDvr58ht", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some Student.^Tutors & Teacher\n}", "derivationOf": "YvRWg5SR4A8h8Mwk2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:37:58"} {"_id": "3cnSvdbvvHNGZ3YSJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Person.Group in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5nu5HZZRXBTnbNDyY", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:56:24"} {"_id": "Xsdcxot7osvxHpedr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5HSB8xzwffA8BsonK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:59:51"} {"_id": "JmfpsTDmgS6xPee5d", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4PAk36MGoxQEnz2nr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:30:50"} {"_id": "B65QwB6fxY5PZeHhw", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7LrqMdxrmzMXYn439", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:03:44"} {"_id": "7isFRvcSczFwSJiXT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student = ((Teaches . c) . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "xhSzsKMPCuHywBgD7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:25"} {"_id": "P868YvkDYjgyPnoem", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NP3fQ89maCw4HEHio", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:47:06"} {"_id": "NB2ovano8DwpS3Qr2", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class | all a: Teaches.c | some a->s->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "t2NqPTjRBhAWsMPvp", "msg": "The name \"s\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:13:09"} {"_id": "P32epivTMDiKt3WA2", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "73EcjBqLT2vHuGRtc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:21:22"} {"_id": "dvxdn7se7C6CBbwkh", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teacher->Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DFZiZDXDCtANqKa2F", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:01:01"} {"_id": "HyqqotoHA2r8GqzLL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {some Person.(Class.Groups) implies some Class.~Teaches&Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X36cofu3QGt3ugkXn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 19:21:47"} {"_id": "HFXrX2u5FA5rEEd8b", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.(Groups.Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p3e5rgbqhKs8xNpn6", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:56:19"} {"_id": "z5gaTXckjJfqugNyB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y85Rmatgy4iZMd6M8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:22:13"} {"_id": "58rDdx4vMYTaatzAH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n ~Groups.Groups in iden and ~(Student<:Class.Groups).(Student<:Class.Groups) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iDR9cRYgJcwbPzowB", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:52:26"} {"_id": "sBTp4b5sFtyFTiv6w", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NTgcqzgRWfhCSa52g", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:15:00"} {"_id": "EMDJsam65LeKh2f4e", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wtFWBaMgvFeusYKRd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:08:27"} {"_id": "K8g4puZQgceSasxs7", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (Student->Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DRQapk7jwygLqziWH", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:43:04"} {"_id": "tZtCeTeYFbMTR7HwT", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bThbDzZp7wfpgZNEw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:20:29"} {"_id": "rfuumfYnWeEk5LDiv", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2e5f65ew37WhuJujh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:31"} {"_id": "WrLys4xy44DHZfCNc", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "LtHecE9yar38cjjQH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:29:21"} {"_id": "n9QpWoSbuYfgqaJFw", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t:Teacher | t in (Person.^Teaches)\n}", "derivationOf": "TMqmSH5mBrJjm37Bw", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:43:04"} {"_id": "NcSAGrm4kFpX5Asec", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Class.Groups - c.Groups) :> (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tdKcQqKGsEEFEJnWn", "msg": ":> is irrelevant because the result is always empty.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:49:47"} {"_id": "9bfqdPiPWAHksa6NN", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some class.t\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jgDfMdAtwrDRzDG5C", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:33:33"} {"_id": "2xLAC3fbo5wWQZNmM", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NBcLukpbZZH35uxrt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 20:48:07"} {"_id": "3aANzhCtE8EpAWcEW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher->c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tKXQ3mSq3QE42hWnt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:09:37"} {"_id": "auq9pxCaSvZrNeFci", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies some (Person.(c.Groups))\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "62rmCahyT7WCM86o9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 00:01:07"} {"_id": "kEMMaP4jx6d8ETk8Z", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nm3FhkBHFNzthzDJA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:51:36"} {"_id": "ph4nrhQLsyeJjR8dD", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \tall t,s:Person | some Tutors.s <:t implies s in Student and t in Teacher \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "WrLys4xy44DHZfCNc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:37:26"} {"_id": "9svaSkX56kLr78s5B", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t(all t:Teacher ){ some t.Teaches }\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SDo3u2eirZJzec9g6", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:40:00"} {"_id": "CpP59bupHeuAo756y", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-27 18:52:04"} {"_id": "2A6gp6SzGFXJad3WC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tno (Class . Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XF7rEK8KW7eqKxWfW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:11:47"} {"_id": "jadzEzWN7w5BST8uq", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t#(Teacher->Class :> Class) = #Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GvjtskRLaAwSckmvS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:56:08"} {"_id": "vzYzcc5ccafdvMHwx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 01:44:06"} {"_id": "Mjf3EBdBfWfhC3xaf", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SHNF5Tf7NdPjhqzfr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:37:54"} {"_id": "zDWtpRxLhZw2yhoke", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).Teaches\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wv3g8DZbTt8ai8YYq", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:14:14"} {"_id": "7X8eneW7kFhS6F6Wv", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EjgmQTFAmXgDXxTLN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:52"} {"_id": "TaXcSHogNfNPb4hry", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R5GJFFSnRSXpTbAMS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 19:53:01"} {"_id": "MuhpcHQpQFBAgJa8n", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c & Teacher\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher = Student.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xeBMxKfpad3nmbRvS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 14:56:14"} {"_id": "r9Tdkd9os6uH93F9L", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { p.Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wifiMQWvaW6rJBwkQ", "msg": "The name \"p\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:32:53"} {"_id": "shgmnCvcb2W5Nhn5Y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher & Teaches.c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ZqwGqKc4P2rWqfGe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:12:26"} {"_id": "tNuAhyMYZJJM2ty5B", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cwtaMG8B7wTEMpfqX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:29:25"} {"_id": "i7amAttDJNfqnwaR6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teaches.c implies some s.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KZRuJwyXGeFgGmwgo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:28:27"} {"_id": "T8yt7LqdQBLycg7xQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QnCFoQdRtJLPpjYBa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:26:17"} {"_id": "fyfhaQH22eL4TQrbs", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cgPzqYqLbPco3SC4M", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-13 03:27:34"} {"_id": "Ley3nPta7uqrR66LE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HLjCxetNYgbnhABEs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:36:07"} {"_id": "FxfW89o897ZudsKey", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone teaches.c \n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HHgWE88XW9QFLzf6z", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:44:01"} {"_id": "KSpeute8RmEzyZXR4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x4b8Rx9s7oLjyJryd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:59:56"} {"_id": "957Khy5LXhqPk6Keh", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person |some g:Group | all t:Teacher | t->Groups.(p->g) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "Sf9vxSrFqKLT7Gs5D", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:36:05"} {"_id": "dtopMcwaL5PE6vcTY", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QsHxf8Q8DpzzChADe", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 00:45:04"} {"_id": "5TukPbNaDYv6BjeYX", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Teacher+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gus2DAgGrvZ69ippN", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:28:59"} {"_id": "FtgTE7eJ75DvcNqi5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "ykBv34LrpgtN2D6Fw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:25:07"} {"_id": "kPHuScakWKiAB2QWo", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P56W8WYWw8CYbGYtS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 20:47:20"} {"_id": "JvfCESGuPc4LciDXH", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nxM6DEw6Lxg9vK6Q3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:11:51"} {"_id": "boAwNi7GeaBfQTzFi", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LvGz3SdKFsymZq2pv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 19:46:14"} {"_id": "EBNpBAE35Xp36Evd2", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H6v3oHtxNTZk7zHba", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:19:51"} {"_id": "ZruT3XcHNTehe322b", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher->Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vw77L3AMNrjsgWtiX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:23:01"} {"_id": "BRxrXeF9ynM6M4Mmx", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KbeK5v5chm4bawpDF", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:44:24"} {"_id": "sYGrGTvp9kFW2FzJ7", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JbXLwqEDf9rN9gEj4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:17:52"} {"_id": "iJEd2ZGvdo7Jca7CP", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies t1=t2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies c1=c2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9q5MyTDX57iCLmyMR", "msg": "The name \"t1\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:52:46"} {"_id": "RGm77yQ6SWhsyirkm", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hZTK8NjfgKQYpR8oC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:07:54"} {"_id": "XNLhagpXLDkkrm4ov", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | (some Teaches.c) in Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wt6A258ZkbNBMbZGS", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 18:38:31"} {"_id": "DWcPTj3aPDDZpPTTa", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Teaches.c\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ihETkJZeSnx7kbzFc", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:59:30"} {"_id": "qMkSypneHnbzhKpuR", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jZuB98AL7QHErdwvy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:56:36"} {"_id": "vd3tWT74aejgQaJDi", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c.Groups | #s.Student > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8SthpB2PY83tT5zoy", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:08:08"} {"_id": "CJbgwiMpLmveyjdKt", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \tall c : Class, s : Student |\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s : Student, t : Teacher | no Student.Tutors and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9YnbLqBDPFxFfEG5e", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 17:08:11"} {"_id": "opASrMph5Hr9ARvZ7", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in Class.Groups implies ((Teaches.c & Teacher) in Teaches.Class)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oRxHM69M9F7RGtyWP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:52:22"} {"_id": "GztMKhP7yFhdQuMN6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student && p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z4Y7Ewz5BRNgFSFnE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:43:17"} {"_id": "pn8NWqHuDSFfoa5v2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person, c:Class| (some g :Group |c->s->g in Groups) implies (all t:Person| t->c in Teaches implies t->s in Tutors)\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "SywRTSMJChCfdz59b", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:23:26"} {"_id": "bRT9sTzAaXxBQy8Qk", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teaches.c implies (Tutors.s in ( Teacher & Teaches.c)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fYXxBjZNNBui8X7Lh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:34:34"} {"_id": "GykDJK6cZsE24MGwa", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t#(Teaches :> Class) = #Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7QEsBnrpmke2pwHnS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:58:33"} {"_id": "uxKvKByaFqdTvZMRt", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rbXGRJwsdjAQm95cz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:15:33"} {"_id": "nzfjRs4zzo7hGtrQQ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups->Person | c in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p9PJ84uusvDBM56k7", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:26:47"} {"_id": "9Zfiwcm4BFnE9jLND", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iz2pjGmWAbQZQgjj2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:03:46"} {"_id": "m4oiBwoHGprd9XBkp", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | t.Teaches:>c implies (some Person <: c.Groups) \n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XZqf6YWSXREtCGZbK", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:57:05"} {"_id": "7CcenzEpmuqF455xu", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LZqQfY88zDeNGNSJ6", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:49:15"} {"_id": "89T8TSRuLeCP9tEEM", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, g:Group | some c.Groups.g.Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u7488yfn5fwGy9fs5", "msg": "This cannot be a legal relational join where\nleft hand side is c . (this/Class <: Groups) . g (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:40:42"} {"_id": "x44g92aWTWvTB59J6", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some t->Group in Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HJpM4xB7M4uCDYJRG", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 15:48:30"} {"_id": "RK8wFGaCY22SzBLwD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies (some (Teacher<:Teaches).c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C2pzim5KD9kh7cBjL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:43:24"} {"_id": "48Pie4EdyJAwqj5gT", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = Teacher :> ~Teaches | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fGDYp7gGWDYyh5c8N", "msg": "This expression failed to be typechecked line 85, column 8, filename=/tmp/alloy_heredoc12448462322075041482.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:17:32"} {"_id": "g3gm8ycv6hAeeZp6G", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QXhN6wW7tiQJxrCjE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:13:24"} {"_id": "LoRNZ7ivivJ5CoTAk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PHC8mzWA8og3BZKhj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:06:39"} {"_id": "jsiipXJCoAepecc6B", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and some Teacher:>Teaches implies some (Teacher:>Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4vXDrf63pEzW7Diys", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:22:55"} {"_id": "P9hD97jumouSLe3JC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) => (#(Teaches.c & Teacher) > 0) else #c.Groups = 0\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dmd2BjW3thcAKNQHf", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:37:08"} {"_id": "QMdAMkDDQsSKE75jR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "HqDGG7gnRc2i9X7aT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:55:38"} {"_id": "ugBEtpo6i3tL8psfp", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c in Teaches => some c.Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hsr4kuFm7kmTfgRcF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:09:06"} {"_id": "5FdENJkmFkMoxSbkQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n no c : Class | #(Teacher & Teaches.c) > 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ckt8yAKXto7569456", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:26:45"} {"_id": "jMcp2RsApCaSqvPFT", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { one c:Class | t in c.~Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bDBSW5iBB3eK4qoRp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 04:01:00"} {"_id": "pBunak3Barofb5LY5", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xjeNbKtx7EhvPkF2L", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:23:46"} {"_id": "3QY7YqLCn8oJwmf3P", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FrtrxsKvAhmzbMipQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:58:01"} {"_id": "kPhyRTD3vwvz32Q9c", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | (Teaches :> c) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R5uFPWJLu3ZtwJQBc", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:50:30"} {"_id": "rDDJGjH3GqovGCgma", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | (Student->Group) in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xS8BFRLbAPPzZFsbQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:39:54"} {"_id": "AvqNwQwP7HqHwddLB", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class |all s:Student|some g:Group |c->s->g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jKnSBQnWhH2fhXkAC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 15:37:25"} {"_id": "C7AvFqT8XESNabE5B", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | one Groups.Group.t \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "H35HJAyZv4zqm47Pc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:22:27"} {"_id": "c9sEMKyhTE42ECSZn", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p:Person | Teacher.p.^Tutors\n}", "derivationOf": "NP56BSAo5twsq3A66", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is p (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:46:37"} {"_id": "3TWLDCRQwGjvf37Rc", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zJjWbNWAszgxJpwgN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:38:02"} {"_id": "kJoGp5YgJ2TzJzGKD", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ytev9JeAHmDvHFKF3", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 200.765625, "y": 199.1999969482422}, "Class1": {"x": 401.53125, "y": 199.1999969482422}, "Class2": {"x": 602.296875, "y": 199.1999969482422}, "Group0": {"x": 200.765625, "y": 298.7999954223633}, "Group1": {"x": 401.53125, "y": 298.7999954223633}, "Group2": {"x": 602.296875, "y": 298.7999954223633}, "Person": {"x": 401.53125, "y": 99.5999984741211}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-2 15:38:09"} {"_id": "gpZywyukAEkRn6HW8", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K9hoY2kK9QBkvkK5D", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 14:47:21"} {"_id": "dLTer7HBufcqrE3G2", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some (Student.^Tutors & Teacher)\n}", "derivationOf": "baWogjSZdBHMT59aZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:39:37"} {"_id": "m2e7hBDSTQGFgssKF", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | (some Teacher) in p.^Tutors)\n}", "derivationOf": "nESs879r9T3ibnviJ", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:51:31"} {"_id": "5LwPeGyXDG2FHPCfy", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class<:Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cowPgYzZiYA6sjZ9z", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:19:16"} {"_id": "pE2PGHEsJoxdQdiRx", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (c.Groups) implies some (Teacher.Teaches).c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "FhZ9e4mZk2cuXiWCR", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:53:33"} {"_id": "yMjCr3HBozrQnYocQ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all Teacher.Teaches\n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wkbRzG9G4WA8bALYu", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 17:33:22"} {"_id": "4A8Nb4NFzpQZSwurK", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Studen\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"Studen\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 16:53:31"} {"_id": "EgL4B4GjsiWTQSxsB", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (no Student & no Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "jZGkgLwaHu2ge2iwW", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:53:31"} {"_id": "SNekeADuS7HX29u2F", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "2rYe7GTYQg5TKcAR9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 10:09:55"} {"_id": "aLoBmp3Yyq6StNHEQ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qv4eimPsjqW6xN9Av", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:28:44"} {"_id": "aZqqLWcNcWFaQKffe", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some p : Person | no Teaches.c => c->p->Group in Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jGArfrD5YZs2ugWgP", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 22:03:58"} {"_id": "fNsyKj9WLHhdsWiRW", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tno (Groups . Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9HfEveWHvgDWdkw9t", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:18:08"} {"_id": "jy3xnebv4EnEYHQNq", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | some c in Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aBw8eYb4dZGe9Z4Hy", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:13:42"} {"_id": "uvpfaA4ZRNN5cuXKt", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n ~((Groups.Group):>Teacher) in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sj8yKSxJgjy5s5WEA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:51:41"} {"_id": "588AeQ4XQabFozG88", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XEnoywqhsiXMtmWr5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:17:01"} {"_id": "QZvJz4WiWXeSuvE5p", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n ~iden.iden in ~((Teacher.Teaches).Groups).((Teacher.Teaches).Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "hebSLBtHLEcMPj4K8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:37:04"} {"_id": "oLc2y9x5vwHymkJe5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tno ( Teaches.Class - Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "MPXxDWM5ZDpFrnrXN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:01:44"} {"_id": "mR4BQTfoGuJ2eGBop", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t(Person in Student and Person in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FS6xtLBQugsszmwtv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:34:38"} {"_id": "H27u5sa6cLNwWDi6f", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all p : Person | p in Teacher implies p.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SyBch2wRdnBnHEqMg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:11:31"} {"_id": "PPcQMMiaHmoSB3JiY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XczKTFQmFQtoxAr8y", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:34:09"} {"_id": "5BQsdo8PWog2xQxbE", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tClass.Teacher in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oqy6zpKFTCrnjSC6Q", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:28:31"} {"_id": "uhP3vQzyhDFS2CZvt", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pz4Dmq8CbLaPKf6rq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:59"} {"_id": "oTM5dxbuGm9ZW66Fa", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.^Tutors & Teacher)\n}", "derivationOf": "nMrDiqtgGPsTL8haZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:40:21"} {"_id": "65dCqjRbpZ2y7236z", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~((Groups.Group):>Teacher) in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5Zoaa4wYnuzPzjXEm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:24:51"} {"_id": "NjEK4tSMchDAwzuv5", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qMkSypneHnbzhKpuR", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:08:50"} {"_id": "9EbWSHhSiZbKkDmEi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no (Groups.(s->g)) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r4uNiW8XcKDAuc92u", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:27:41"} {"_id": "5WdtrfAeC6iPZmnbt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dWx5SLTkjsiEmz8WL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:43:23"} {"_id": "wtFWBaMgvFeusYKRd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "agtk4AKJ3CbW9LNru", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:08:01"} {"_id": "Xn7dneombu2mQxX2f", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher, no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3jCG7kr6ujE34gafx", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:08:24"} {"_id": "voXL2m4mEidNsMcvh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | t->c not in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F2cLEDuot33vChoJS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 12:03:16"} {"_id": "grE6dR4kjmnguF62r", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g:Group | some (Class.Groups.g & Teaches.c)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "ZexGc6DWTNamPi9Sc", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:56:22"} {"_id": "K4KuzrF7z8iQHakGH", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TJtJguACu6EKR3X97", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:58:14"} {"_id": "ehwAL5YP2xL4NMbFd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n (Class . Groups) . Group in Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cDMHt2BvNNddodJbc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:35"} {"_id": "Na3Hwr6yJw3ReXfwn", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c) - Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GwcwvNZx4iNBwenMk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:46:58"} {"_id": "wihxzrQRSBnTM8x7L", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y8TYfYuQNd7ErqfMP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 16:35:50"} {"_id": "bGETCBLTDnWJ3ebaF", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all s:Student , t:Teacher | Tutors.s in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "H2JEg5NqKFb6esK4d", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:08:56"} {"_id": "amygPFmJ2WMqB7JHb", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * http:\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "YEAAtk8ezbXwtSkAu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:53:48"} {"_id": "jmyw8gDNJkQNmThRS", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n\tsome c:Class |all t: Teacher | t->c in Teaches and some c.Groups \n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "bckLpim5q3ABEKCMa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:28:58"} {"_id": "YJf6YEBxFkhQq672P", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8efyhb5Jxs8dLgzSq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:27:18"} {"_id": "4PAk36MGoxQEnz2nr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Person.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NanbPd3e8kJ3ZmDuS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:29:34"} {"_id": "NJjRYHcLiceycS4eE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall s:Student| some g:Group | some (Groups.(s->g) & Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "i4hPYkTmamZNHZ9iv", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:42:33"} {"_id": "BYXZHJEhHmB7t8q5k", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all (Student+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J2B7422L3R8HC3Tur", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:40:00"} {"_id": "SGFdPN5D6jojwf4Fc", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all c: Class, s:Student| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "p2qF2jhL2ffnks3ss", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:52:29"} {"_id": "XZLRoywF8WQAa9PHy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NofhwxQfM3oPwWuzQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:27:08"} {"_id": "v84FnHh4pYWwxym9B", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:27:20"} {"_id": "uMHwAsrNQaeWntTdX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person, c : Class | some p.(c.Groups) implies (Teaches.c in Tutors.p)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q5xNCXZoYaqDFj6Ge", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:32:53"} {"_id": "3WEpDcovxXyYZykcd", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BhzXQirP6s92pHySu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:09:27"} {"_id": "wSRJvj74snbXaXyp9", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n Student in Class.Groups.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kveSFL638tZQRiPx6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 21:35:26"} {"_id": "zwuXk8BWnCeHHCi5R", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeaches.Class = Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KRgsYWbmNAtxCMzjS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:02"} {"_id": "XiYiZYDSrZfCxvqzB", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "StGQ4h659wuYXnFxg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 16:41:52"} {"_id": "J6SCcCuaZePsHZgKQ", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t(Teacher & ~Teaches.Teacher) in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g7dpkix9NeqZvem8e", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:30:43"} {"_id": "D9iM3avAGDdHMTuW4", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnot Teacher or Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DgoSDZ3uj8vRd8aYc", "msg": "This expression failed to be typechecked line 60, column 2, filename=/tmp/alloy_heredoc17243226724011902098.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:37:46"} {"_id": "ZoRr43MLgHLuyBmXi", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Stundent\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"Stundent\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:17:28"} {"_id": "tyLpTgaA5CwmLe5NJ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tXED5dMpjjXS2AbTF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 23:28:54"} {"_id": "hdkjJTWitPrPj47ci", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "HbxNKppRxone3jYui", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 00:34:36"} {"_id": "kJDzTmfENg6AcBoXC", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Person.^Tutors in Teacher\n}", "derivationOf": "3g4mxkrByhaQgf2Cr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:07:47"} {"_id": "tBQwedz3o6kTnkhWa", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | all p : Person.(c.Groups) | some p in Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zavoFfoRZEnhgkJvc", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 18:05:38"} {"_id": "FtkxjmKQXddoRoePs", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Person | lone Teaches.c and lone p.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h4SdzxavXquZEfTrT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 23:00:54"} {"_id": "sbFs34c77PuQhrbxn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n no c : Class | #(Teacher & Teaches.c) > 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups implies some (c.Teaches & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2f93c9YJTSSaH5dGf", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-8 16:28:59"} {"_id": "L4AxyZrvx8Csvyhzt", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class| some c.Groups implies Teaches.c in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w8Y8CnFJPFWWZA7wS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:49:21"} {"_id": "tXtR82htKmmJzZme6", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone t.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9Zfiwcm4BFnE9jLND", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:04:05"} {"_id": "EAecDCpPWQEWczHeS", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "abN5wkKYEsS8cDRhi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:31:58"} {"_id": "jDtrcDzy7AQzcPswi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\nsome c:Class | some Teaches.c\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ypFgt46FxAa46tmyG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:38:35"} {"_id": "8mZyA55ZhjLR6EpSW", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pbGBsiEkZbji7HTxR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:51"} {"_id": "mMztxrGuMiNbBd93D", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | not lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S2ZZRrESw9XFajQKe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:54:10"} {"_id": "LPDR2nNM9qxhxzQZ5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bhYK4HDRZyek7MZsX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:33:05"} {"_id": "aYQ3nqT2J9AiCp62E", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n all c : Class | some s: Student | s<:c.Groups in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DXW9KkQr6jcshdrKw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 18:43:26"} {"_id": "wXgN7fdsZ7jbTKzTY", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "GnyCaAQZbNSHEDr9q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:51:50"} {"_id": "2JM2PfAjRjLXMxxuT", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ibza3ZoLnTGAx3233", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:37:27"} {"_id": "tkrGeJLPumPhdc3c5", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Person | Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9W4MDaTCeKFpTXmw4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:09:56"} {"_id": "BnT776Pb4pnKBHWGf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YAwC85e2h4ktSDYCg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 23:24:00"} {"_id": "x5jTfpKDitJRxfBnt", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | some c.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9yZqN26RhMqiGGX7S", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:45:12"} {"_id": "JuPSaKExYb6tdZiLR", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches in ~((Groups.Group):>Teacher)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uvpfaA4ZRNN5cuXKt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:53:04"} {"_id": "N6ZD3sNQK9CB2kBWh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c && lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZrBmLw7WqaMdLhSJC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:42:22"} {"_id": "2qkDjaTJ4qGpAc8JS", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some(^Tutors.s & Teacher)\n}", "derivationOf": "ozvNWCJsLJccNiu8i", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Person0": {"x": 492.6666564941406, "y": 132.66666666666666}, "Person1": {"x": 492.6666564941406, "y": 265.3333333333333}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 11:00:14"} {"_id": "MX6jHifw3pRxQMcKr", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uXXZ96hZ5bEdnfboG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:49:59"} {"_id": "XR9AgYtEe77ymrw7p", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gpZywyukAEkRn6HW8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:47:34"} {"_id": "fa7ay7kFpNazJxmQX", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bnMwnNg5EKTcosEHv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:35:45"} {"_id": "cwauCdvR2btmmr2Td", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n iden & (Class->Class) in ~Teaches.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QzKGjCkoBiQF7WESS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:40:58"} {"_id": "YSW579m9pRKSqWp2f", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kw2awjETCCevkxShe", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:09:58"} {"_id": "noZTHiFgkfhAgh3d6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student - Teacher + Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9i2uGNzf3Bv8Eh2co", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:53:33"} {"_id": "TtqDRxSiGbg7Q3Tnq", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tno (Groups . Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LPDR2nNM9qxhxzQZ5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:34:45"} {"_id": "PpJ7axbzM4HEAo2Dx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mgfu6kXybLiToedpR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:15"} {"_id": "8bYih7uAr2YQuvwE7", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher and some Class in Theches\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GEnt9E5qNrcZ6Ynda", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 14:18:08"} {"_id": "oAp6nj7AeQfzy7mue", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "6TJJnG953CEreCSrX", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:59"} {"_id": "KtzdHj538F6GQuZww", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Person.(c.Groups) implies some t:Teacher | t in Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZTkHvYRx8wgq3QAdT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:38:14"} {"_id": "9rtFhiimN8TS5Wb7n", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).~(Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q8JMFa93rgRkHH4ky", "msg": ":> is irrelevant because the result is always empty.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:22:37"} {"_id": "62gSSLveSJgkjNKWi", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person, c:Class| (some g :Group |c->p->g in Groups) implies some t:Person| t->c in Teaches \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zvgDe7bDFqzetkCKb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:12:25"} {"_id": "Y85Rmatgy4iZMd6M8", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AaCcWCMTSpnGNxG4j", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:21:18"} {"_id": "KnAyubHjALZAYFPm7", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vkcMhryPsZhFHm7hd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 19:46:56"} {"_id": "smxJ3krurgeqdRn5e", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher | p->t in Tutors => t in Teacher and p in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sNLq6fuh3a4LfAatn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:43:35"} {"_id": "x6CKyrzNnAisF9fNH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | ( Class - Groups.(s->g ) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MH3tBRcsg5GXuy34E", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:20:44"} {"_id": "oc6cCBurxKxqoCz5X", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n all c : Class | ((c . Groups) . Group) & Student = Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "atLLNMHchTE8zNrpA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:19:23"} {"_id": "P9qyQiWMk6wZv7haj", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 15:28:59"} {"_id": "xvFhcM24xLyn787Ph", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hJQpdTAjdGerqhbAc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:54:40"} {"_id": "joKQeJ9zXPmncaB63", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups)\n\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pLNAYAGFQ3yjMBiEx", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:23:51"} {"_id": "w5QJxz83cocPZRqWQ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | p in Teacher or (p.*Tutors) in Teacher \n}", "derivationOf": "vYxpbQJboMQvryA8B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:14:29"} {"_id": "S9PrSo5Kyaiab2wBB", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Person.(c.Groups) implies some Teacher.Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NygJ8wDCWvXAJyAzN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:36:24"} {"_id": "Mv6CNriM2fPe3a8sB", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tsome Student + Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tPerson in Student + Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RgHH8v9TK2BpxPTdJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 14:54:35"} {"_id": "W4AGYSBBHkHZAqNHG", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((some c.Groups) implies ((Teacher.Teaches)->c))\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fTySK93MGHYGeNKM8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:20:11"} {"_id": "KF9CFtksmKfmvLBQQ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies some Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HyMxTiLp3kcFLNcuW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 19:52:24"} {"_id": "g9fg5Q6kjEjWAQnQo", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Br6vDbiS6Rz2j5ZDJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:57:02"} {"_id": "diimAoBZ9JscFtdEL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c: Class, p: c.Groups.Group, t: Teacher & Teaches.c | p -> t in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K2qBSKfddcbFjCXWX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:11:35"} {"_id": "cvCnvcMCDnbXQgdXz", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teacher->c < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PdLuJgXnoh6DZkhjQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:38:42"} {"_id": "3yn38qv6Gyjxg2zFs", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some p : Person, g : Group | some g.(p.(t.Teaches.Groups))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TCs3A4oJQa8uHzRMo", "msg": "This cannot be a legal relational join where\nleft hand side is g (type = {this/Group})\nright hand side is p . t . (this/Person <: Teaches) . (this/Class <: Groups) (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:27:26"} {"_id": "72uzgaCkWacR8Gi86", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { ~Group.Class implies ~Class.Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zyjCBKwiG3Yxq7xTR", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 23:01:46"} {"_id": "42cq6cgwz4g7rSzFg", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher | some(Groups.t)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "PGzFfSfQuAqYs4mDq", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:06:13"} {"_id": "Hh4SJNWP2bpxNazpb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tGqdo2eYJvm2fbo7K", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:33:34"} {"_id": "mahecyh4NXTQA94XT", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups implies t.Teaches in Class\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YzAojKg2T3CZ4YHKm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:48:28"} {"_id": "FvrDiYGbKMN8FgNDj", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t: Teacher | some t.teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CfbGYAccKBn3Xcnkn", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:14:34"} {"_id": "jdctFhbtx7HsB5aA4", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (Class<:Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qBSpKA5pbcPA7MEcH", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:18:04"} {"_id": "zHjk3BkdruK3vWmD7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teaches.c < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rnJovmou2jFe5WbAP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:17:54"} {"_id": "tYNf4TybDKG8prY7g", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some ~Teaches&Teacher.Class \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EFD8FdRsp89vPQvKC", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:09:15"} {"_id": "c2uc45Di8FmNyNqTT", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3La6QF6Ybo7A2yvAZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:54:12"} {"_id": "jcuG8wRu5sjLgnmGY", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NSK48nmLT9fzHviDp", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:01:17"} {"_id": "yeg6LQGt4PR7MYhhk", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RmDTKL5JjyQhrXT2S", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:45"} {"_id": "YKDQ5dcNxnYmaBqrp", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "35uKLrHamCqc7huqW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:02:43"} {"_id": "3GZZq59NDHBeFSPrN", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class in Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BpjPyp2ZTEtAQSTAT", "msg": "This expression failed to be typechecked line 65, column 2, filename=/tmp/alloy_heredoc624161663666965487.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:06:24"} {"_id": "b4eWHb6zMutZfeHbu", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jzgdqu4NE7fGRnJHB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:54:45"} {"_id": "S9Ee9RRtHc3KG4NLr", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uNEiZqcb6gZiYfauo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:47:27"} {"_id": "kWpDFRWvX9S6sMnBf", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some x:Class, t:Teacher | t.Teaches.x\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mRC2962o5HMdK8q4L", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is x (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:17:32"} {"_id": "FJNKqc5b83gbaiKRC", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ()\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "QMLnQN8Ed9BpqTKMj", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:20:47"} {"_id": "LWLPrgnF5WqfT4PAs", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c : Class | (some p : Person, g : Group | c -> p -> g in Groups) implies (some t : Teacher | t -> c in Teaches)\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rQYpsGoLxEP6ydxq9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 17:53:19"} {"_id": "Bh6hvGvXGgXgcfYDH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | one Teacher.Teaches:>c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r8i5LSZbYswJg4EMX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:06:14"} {"_id": "sNLq6fuh3a4LfAatn", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher | t->p in Tutors => t in Teacher and p in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cdKAqM4PjqFoM2kXJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:43:21"} {"_id": "RAmFTPFNHh7DLo5C2", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PDfbBNKS63yvFSf5C", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:39:25"} {"_id": "4yBWaFMoXeP7humLh", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WfyXJsYbSjNSbsZE7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:23:18"} {"_id": "DCqgvw5YSmtHx9b5h", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:55:19"} {"_id": "yHkEbFtbCB2k4WoKs", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tone Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6EutPR5rQFMbG2khK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 15:21:09"} {"_id": "fffsBsr7Xn7XNYMqN", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t(#Teaches ) > 0\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sc9NpHTY5DYirgLfi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:26:58"} {"_id": "fnH5QME9R6RGShren", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher in Teacher.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G2A8TE4jaaR9K7Tib", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-4 07:34:15"} {"_id": "wb7MwrLX5CsZGYxhf", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some t.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mm5kSeppEkS8Z3NBb", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 12:31:39"} {"_id": "ZXhiaqXvKRApCW9dL", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tno (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wtHvygpHtCNsH3gEf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:08:59"} {"_id": "5ot3cEv7k5kNJrLdb", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 23:30:24"} {"_id": "Svai3jZ7nMZ65ZHDc", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) > 0 and #(Teacher->c) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KmKizNzEaoDGjGRCN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:41:15"} {"_id": "JiAE8yRmoDZuAwiMz", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class| some c.Groups implies (some t:Teacher |t->c in Teaches )\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jooZzfSW5maBojmQG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:46:30"} {"_id": "KD6DGYw52M9dC85Mx", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BeNtb8dA4uujiH8H5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:09:12"} {"_id": "HwximXSmXkY8PujXG", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gLkHLYvvzHxbJ2n3c", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 18:57:13"} {"_id": "ycoSQLmvc9zXczEbo", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | c in t.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YGuLZT7g9opgwLcp2", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 03:54:27"} {"_id": "p7L4sF9B3Wej4NzmH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TWrNymiRGYhKQYpqi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:29:47"} {"_id": "Sw4qcv5EnCJzSpq2t", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8mZyA55ZhjLR6EpSW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:29:13"} {"_id": "DAxhSaXEB2S5A2fSK", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some c.Groups & s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P4W7GZzBffWs3mfQp", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:23:45"} {"_id": "MKErv2gaAMWtccEiS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (one (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "sEQNZTkD2uLMnAeTa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:05:35"} {"_id": "aq4D6pPQgxJX7xWRY", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno p:Person | p in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nno p:Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nbwERPxNzsZcm6sGt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 09:54:14"} {"_id": "2qTjn3LtoChyML34D", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher<:link\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fsHe9EGk2iGuHJ99T", "msg": "The name \"link\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 21:09:10"} {"_id": "hNdrq4t2zSrkLbsBY", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher<:Teaches).~(Teacher<:Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Person | some Teacher & ^Tutors.Person\n}", "derivationOf": "z3YmczTkHwXcpvqDq", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:23:06"} {"_id": "oP69gRFPn9WEpsEFY", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| no(Teaches.c -Person) and some c.Groups \n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "nxjYiETtxN3x3Dnjz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:26:10"} {"_id": "rE6qGgFYnR2EKKeti", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class, s : Student | s in c.Groups.Group\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wSRJvj74snbXaXyp9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 21:35:35"} {"_id": "BC3XwTkHRopZ58FJq", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n Person = Student + Teacher\n no Teacher&Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fyfhaQH22eL4TQrbs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-13 03:35:25"} {"_id": "ys3LMXgA6RuxbSbBx", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | one s:Student, g: Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "comXQwN7EvhNKzBqT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 17:22:25"} {"_id": "EcuXBcL8qhX6dNtKE", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aQhji4RW96nbvjGYT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:02:22"} {"_id": "Z9WjptpxBo98X3Ngv", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher | not t.Teaches \t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "RuWxxzdvJLB32BneK", "msg": "This expression failed to be typechecked line 89, column 20, filename=/tmp/alloy_heredoc1139725682146428120.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:06:19"} {"_id": "yS5kofyqg96NRFiQ4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pg7HEN5zdmrqddZtG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:34:07"} {"_id": "pw6YpWNt77bgPXb6S", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ALToRHfCQYHwcSsfG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 23:02:37"} {"_id": "Srd6WTHpsHxEPetQE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no ((Teacher <: Teaches).c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FmM7cMWMS2Nw8CTpK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:15:50"} {"_id": "amnih3TuotMnPWfhx", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n Teacher.teaches\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xECvgyC49Bja2mwFh", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:29:27"} {"_id": "xzzp4YrbA3zPPZQKX", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f3dLM6PZhwsAuaeya", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:37"} {"_id": "H9HFhYuB8zwaNoLTr", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher.Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ax8LxNHZfhu89iTxj", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:39:18"} {"_id": "jbe2cNnrJ6WnripWb", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XBY3qA5Z3CjJHGi4n", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:05:34"} {"_id": "R9s5aq8k2i7bvJMsF", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wC7TEzc6EojNuc879", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-19 18:13:14"} {"_id": "KS9FurBWkpLFJCdXL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some Teacher.Teaches.c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "mgr5fbz53WPZZxRnt", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:49:19"} {"_id": "gdsZAM4HpaYmMdykt", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all s:Student , t:Teacher | some Tutors.s :>t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "chAQJAMGxLqDEsYMC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:08:22"} {"_id": "qfSoLeKvkvDdaappy", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "aSk3mzybAXwKn4MJ6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 18:56:21"} {"_id": "d8D2k8AZL3padiBjz", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class -> Group implies Teacher -> Class\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DSsnAMikL46pYu8Pi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:53:38"} {"_id": "CZmD788MoDfKHjGLg", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class | c -> s <: Groups implies (Teaches . c) -> s in Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "mcgrrTdoXw4qSkx6Q", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:39:43"} {"_id": "mZMHNX7Q3MkgxXA47", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | (Student.(c.Groups)) + (some Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ToAHttCkZkmWWJM3b", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Group}\nRight type = {PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:15:28"} {"_id": "kAfJTursJoWEQsRpB", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test { inv5 and not inv5ok}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9aGHkZFk73JCqjyRr", "msg": "The name \"inv5ok\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:57:40"} {"_id": "bWMhPqFdar4RqfX5R", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome Teacher<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4Ja7brkX3Jg8ntnXG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:49:55"} {"_id": "3Ke4nTEfPEk99WY7R", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall p:Person | some Teacher <: (p.^~Tutors)\n}", "derivationOf": "omBz6uZc658QfXHaW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Person": {"x": 513.5999755859375, "y": 199.13333129882812}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-5 09:36:37"} {"_id": "KHSCA38w9R3C3G3yY", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wchEKMzh2kPFerCzx", "msg": "The name \"teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:43:16"} {"_id": "9zfNCnQWDJ2ddHnmf", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno p:Person | p in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HvNjiDKSet7nsbjcE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 09:53:38"} {"_id": "sbWm2joBGmg32GfHM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yFm7WNJkuHCtv2H2L", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 15:53:13"} {"_id": "AR7XBvrCQ5eoCLCJj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \tall c:Class,g:Group | some t:Teacher,s:Student | s in c.Groups.g implies t->c in Teaches and t->g in c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MsKuNjQPAD8mm8LRj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:47:15"} {"_id": "Krjc9gES8SE4WZfGw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "AFXXJ3fkA4sJzJZx6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 22:46:13"} {"_id": "KWFHpsG3XWfFzva5s", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Class.Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WjdGA6HHSD9qrWdMM", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:18:17"} {"_id": "Aphp9A4oAFq9dd4n5", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tTeacher in Person.^Tutors\n}", "derivationOf": "MYBG2aKFNyPwrDMwb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:26"} {"_id": "SyBch2wRdnBnHEqMg", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all p : Person | p in Teacher implies t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "49Le6dBffjD6dkyj5", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:11:26"} {"_id": "otpmPmCaDEQwGrXQd", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o27rDBZL5hv8rv4SN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:32:30"} {"_id": "Ln7uoR6a4fYp98vi4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bBuj95e8TNs6837CY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:40:43"} {"_id": "u4yoNhYxZCEBdCWhq", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Py5dNeD6SgLhEZP9G", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:58:40"} {"_id": "aYn8sNDeQAGyEm8uT", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher . Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teaches . Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sAkMr27Gz78i3fvB4", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:31:49"} {"_id": "Tv3CPHJeS3YWYqzQ7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dko2g5FbkFTYCtk2v", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:13:34"} {"_id": "nf2t8sAHFH2icCfpa", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "itcSMrwaA9ZjoBepE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:33:40"} {"_id": "BqbLPXYGP6NELezxs", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all disj c: Class, s: Student | some c.Groups[s] \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r9Z5TENNnEqP7iWGk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:37:44"} {"_id": "R4P7W9YCitq9FNki3", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t#Teacher.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yPiCjTbZYSNvqm9Zw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:32:18"} {"_id": "tT5XHZY5PTEfrj8en", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c->Person->Group in Groups implies some Teacher->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qEpK5SG4D95xKLW9y", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:03:05"} {"_id": "D3N9CZZzgWnrum7GC", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some (c.Groups).s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cM7Xec8DxFFDt7Tus", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:09:38"} {"_id": "gheZm4EMJv24eBwHP", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5zquiacMdxH2eDC8e", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:34:06"} {"_id": "eJnk3XvKC5LdM6esx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P3cezXwiy8Xuoxngv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:51:50"} {"_id": "2sGFSR8YPrvogFfdp", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tone Teacher.Student\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ejSpMykc6cTPZYFPW", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:36:24"} {"_id": "YMx4EXtuqD25hBhXC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DpGiCurnJdwjsxW8G", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:39:47"} {"_id": "X2C7sczBAFMaEBccy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and some Teacher<:Teaches implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jsiipXJCoAepecc6B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:23:01"} {"_id": "YrRWgQuPJv9YDXGbX", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z5DbSYe2H5QGmaiDB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:44:46"} {"_id": "6RgXYxRPoLXB3tfRB", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeaches.Class in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZkMxrjxP3oxYgb7am", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 13:49:33"} {"_id": "cALBpCvWkfx8Q94kQ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups implies some Teacher.(Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "vwRdYHnxh2kdFCogN", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:48:19"} {"_id": "DA94pSakzTWjHCve6", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zDWtpRxLhZw2yhoke", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:14:39"} {"_id": "XdnJ8KbDSqReAGKzN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "cMwAduzxSdFpKjSQZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:14:29"} {"_id": "Zyn2cYmMZLyCvK4GG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class -> Student) . (Class -> Teacher)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NuP7rPGjCD4mZedTq", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 23:09:28"} {"_id": "Guqye6EHTNpCDiwqG", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student | Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m6CeracaJtjjPLH7f", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:19:36"} {"_id": "cckZ6tAfk4RWFKt7F", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8NGvw7htwvhsCMoD7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:27:56"} {"_id": "iws5pnnBWzfkdAuFE", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YL2iPbb6uWGFPtF4t", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:01:01"} {"_id": "7o3FEzQ2EnMiypuxy", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { Person in (Teacher or Student) \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Student or Person in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P2Xg4NTj3Aa9oAgHd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:50:52"} {"_id": "CcdRmR7sZwx3iEXut", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {Person in Teacher or Person in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5Antg6jk8tccQ4x4B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 11:59:45"} {"_id": "N6wscFSt9QyDXkFng", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hu5EgWYaQmiaKS6gk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 20:30:54"} {"_id": "eetrejn3j85dGLQxE", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QekTa5B2J9eNj3Kry", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:32:22"} {"_id": "R5TAJY3RPnmsvx4mR", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YdzQoferNYtnbZ7eK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:09:03"} {"_id": "Mqb4FvbSNLGgzd7ig", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C9riXwqyds3ozADTQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:34:36"} {"_id": "DtbGYnQcj45CcdKDt", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Tutors.c.Groups.Group in Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eCX2uZ2rpgnpPhKWw", "msg": "This expression failed to be typechecked line 103, column 19, filename=/tmp/alloy_heredoc3611328435752120581.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:10:07"} {"_id": "xxjCebyHH5yiXEf9N", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some (t<:Teaches).c \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K48ZRDyfArs2WbXPD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:03:06"} {"_id": "Fjk8DRAQZdv9Pp67S", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "kBmX4J33JYTnmphXM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 10:12:26"} {"_id": "qsK5HkfwnWAhiEdAM", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (some (Person - c.Groups.Group) + (some (Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8TBzMyjn4JCGfxAMm", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:47:07"} {"_id": "xskgZHvB4xcaAfags", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-7 11:55:57"} {"_id": "a8f7acyvwxk7MArEd", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person , p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uHT6ACMBfeLQsM5EJ", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 15:19:49"} {"_id": "qMfiBht5iecAFkjKk", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teachers.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3SZHfx9yAzEGMjAdX", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 13:57:42"} {"_id": "HMcqqqBPRaRkwg3th", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone (Teacher in Teaches.Class)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bbAMXfaSmfTi2Dany", "msg": "This expression failed to be typechecked line 80, column 2, filename=/tmp/alloy_heredoc15859645719922160764.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:05:12"} {"_id": "oeJtE7RCGiFWGwtCP", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E8LdzLRtgPHAwC2Fv", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:57:06"} {"_id": "RcDG3ChHmNwT3o8nP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in (Teacher & Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ozbCqLSRnonu4MstB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:53:14"} {"_id": "uPMW7W7e5cSkdyTZ3", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t : Teacher | lone (t.Teaches & Class)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QqePpCejtBQYS3hWe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:02:24"} {"_id": "BpjPyp2ZTEtAQSTAT", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches . Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cg3L6bwqC7zfehFoG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:06:00"} {"_id": "ABAe37m5QfZ8WgZzC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MHb2qWTYa3MTtCv2S", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:18:28"} {"_id": "H5T93Su7xKM2zBDFa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.Groups.Group.Person in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c9Eib4GdpyqHNDEjF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:55:45"} {"_id": "ruj4qogSifwLytSY4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ugBEtpo6i3tL8psfp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:11:26"} {"_id": "cxhysKPLStD5upe5X", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent or Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RGm77yQ6SWhsyirkm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:08:25"} {"_id": "SZKt3v5nnA65CFtop", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ePLKmaPE3296FkxGd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:04:37"} {"_id": "rqWi5Cih3sP86NwAX", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gYwqkP27nEDP66LWz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:02:57"} {"_id": "oPi4Zg59qjzi9Tjsg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fYJmyB3s9mSFffqPW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 21:35:18"} {"_id": "dCS748S6G8nzqRrAy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iYhwQ5bcyCwdFuTZT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 10:32:13"} {"_id": "bFzYB4BZ6ZkDywun6", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some Tutors.^s & Teacher\n}", "derivationOf": "wYpgJRJNmvejwxBZr", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:52:36"} {"_id": "RbCPMPstCGiyyCZzJ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lv2FRTcusP3ZruAGg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:24:04"} {"_id": "AsfbKxfgrptvKLcQa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all p: Person | some g: Group | all c: Class | p in Teacher implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dkwW96x6FNCbCotQ8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:26:20"} {"_id": "32RZjA65cBCEmdtBT", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | p in Teacher or (p.^Tutors) in Teacher \n}", "derivationOf": "YJFMRpSuGzp9PFMhz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:45:38"} {"_id": "pqJhqa2NwRdDnT8ae", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qFCDwPF8Wprp7Yrma", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:06:54"} {"_id": "MpGyTNox7gfxpwFMt", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Student, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z8RM6m2QZmWH3DYk3", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:50:42"} {"_id": "5RaiojggBonFjXgBL", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ADGdfzAFiC3xca2Lg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:54:30"} {"_id": "jKnSBQnWhH2fhXkAC", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | Groups.(s->g) & Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fCdG5HFKMkWjfmWt3", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:36:57"} {"_id": "HRccqt7usZq4m5pQC", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "44yHa3ZBbRwJeYmdB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:27:02"} {"_id": "uowbFWyHxD27n3smA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, g:Group | Student->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QRthw2uB2sHX8qLk3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:20:53"} {"_id": "2CunhP38eBmF6xh8u", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n ^(~Tutors) in Teacher\n}", "derivationOf": "M7MByJW2gMZL9jqd7", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-16 03:26:03"} {"_id": "dtv7FSYsuLKMWx4Xq", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | some c.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x5jTfpKDitJRxfBnt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:45:18"} {"_id": "fwYTEv7MqsjNKd8jJ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HHx8xbT3mfoeRJjmX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:42:22"} {"_id": "GaStn9o2FsDre7tDS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches . c . Tutors = c . Groups . Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WJmC7qDsGyxh8DWmk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:29:27"} {"_id": "wTw7uajLzv6eTzz5m", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t8YoWfF75FEi7SDWb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:49:57"} {"_id": "sz2ap8CJNq7jFoky3", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L6Hn9ZyvkkXpy4oj6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:42:26"} {"_id": "5s7yq2ZRbzNbvSWtn", "cmd_i": 1, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location {}\nsome sig Name {}\n\n\npred noSameOriginAndDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\n\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\nfun commonStops [x, y: BusLine]: set Stop { x != y => x.stop & y.stop}\nrun { a, b BusLine | commonStops [a,b] }\n\npred test{ noSameOriginAndDestination and locationHasAtLeastOneStop } \n\n\n", "derivationOf": "pgpq4qwGYRPNjQz9N", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 17:15:40"} {"_id": "ycNf8fHHpamJTFcKQ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teaches.Class in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dfF952ky7MBAbSmy8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:14:38"} {"_id": "KkoGrz4dAKrA9mZvq", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student, c: Class | c & s.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NPWtrvoYmoNMQ3CSt", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 18:09:53"} {"_id": "Lq2SL9wmND3yLs38n", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { no Student or Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6e6FGSQ7g9Z6Mmcy8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:44:58"} {"_id": "u88Ksc7mveL62EM4S", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7TzcLifcn7wNSSZid", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:08:23"} {"_id": "jYk7H6gP9kvx22zev", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Class\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EZvQsKdyNKCkuGJLm", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 12:23:19"} {"_id": "ZexGc6DWTNamPi9Sc", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | some (Class.Groups.g & t)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "TSGS8cMxJqCMJY9Ku", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:55:15"} {"_id": "7KaRtj4t3cBg3rvfv", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p <: (* Tutors)\n}", "derivationOf": "naH6hpcuCf3uN4Sok", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:45"} {"_id": "d37waegohfo47a35s", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p: Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n not some s: Student, t: Teacher | s = t\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p in Student or p in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t: Teacher | not no t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BGrN6czAg4dqKQnkk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:36:31"} {"_id": "dCoCptrLqvdX7HEq9", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AEPH9txz28RNuBwsJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:23:12"} {"_id": "Q9tx7ciRYKzLKht55", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher in s.^Tutors\n}", "derivationOf": "Yecd7ygLX24mL6Lrv", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:59"} {"_id": "9htjdh8H4vJmfbyD6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MPJ3x6338reEKcMg4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:45:44"} {"_id": "eJrAsZAsxJtFEidHP", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t <: Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WR4cpPy5TT6ivrbBJ", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 770.3999633789062, "y": 132.75555419921875}, "Class1": {"x": 513.5999755859375, "y": 132.75555419921875}, "Class2": {"x": 205.43999023437505, "y": 265.5111083984375}, "Group0": {"x": 410.87998046875, "y": 265.5111083984375}, "Group1": {"x": 616.319970703125, "y": 265.5111083984375}, "Group2": {"x": 821.7599609375, "y": 265.5111083984375}, "Person": {"x": 256.79998779296875, "y": 132.75555419921875}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-4 09:44:10"} {"_id": "k3WDEK2iRyeJi6eEb", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TSZnJwHomQsGLtMrX", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:29:53"} {"_id": "376R6otT6jJn5g7dQ", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | some c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XnXbmWuSTj3SvrMDF", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:34:44"} {"_id": "SpKLLPA4D9u3hLW4s", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ovrWWJARqLNFZ2tYB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:22:23"} {"_id": "D5H3yaL5ptjAF4nHg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c.Groups.s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bLyqB6gdJkBaEodmS", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:07:55"} {"_id": "5Cxf3LwDi6nqq5XAy", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DeD8cHguaCL5k969a", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:47:51"} {"_id": "Lks8fAtp3wmWgWLhc", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | ((Person -> Group) - c.Groups) + Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nq5evtEGarfgJhCph", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:53:11"} {"_id": "jrgYqimh2xCP572PG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c56zu2HFwKCBGgh8N", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 18:27:38"} {"_id": "a47uMdLGMkuHS6otd", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors) -> Teacher)\n}", "derivationOf": "4XE9KzvRWK7TaMHDp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:25:17"} {"_id": "3vAibJghGAWxpWce6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6kqWHbak5nQjsnJvg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:11:16"} {"_id": "Ht7Y4AMfERaxtLjCz", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | s <: (c:Class).Groups\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "TtKm42oLDKj3Nezob", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:26:10"} {"_id": "w6Pt9svXXtzmxwxde", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches >= 0 && #t.Teaches <= 1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "feg9PjCA4uxzPFFMq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:48:08"} {"_id": "9ghpAHCfqKxrzoqQJ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6SRtX8sMd4yovGyAd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:19:05"} {"_id": "ZzCcuZvtRfXwWJCFE", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome g:Group | Groups.g in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4vCcNEZPwE4Tfc2Rv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:55:43"} {"_id": "QcrB7A6wZ92bGi8Z2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | (t->c + t->c1) in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone c->Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qb9GAZni9PKFmmZet", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:26:52"} {"_id": "qBSpKA5pbcPA7MEcH", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (Class<:Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qCcZSr3yuAPkydQkm", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:17:56"} {"_id": "CvreT9c8TSBrnWgBD", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gPXatGoXjj8W4KYwp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 10:41:04"} {"_id": "QaC9qbMxyBQFf4D9Y", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L474srti8vXPRnzNu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 19:39:24"} {"_id": "8Nk5Fd5Jt79gKJhuo", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n no (Teacher & Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RcDG3ChHmNwT3o8nP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:53:32"} {"_id": "GFYvdbq3jkRChgEJQ", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MidvtWghhvtH3HstE", "msg": "The name \"Teches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:12:24"} {"_id": "ijSfsgFTAGtdWJE7h", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c->s->Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6SaKTDtHbkfiD6pbh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:39:08"} {"_id": "zcvgDExRtqLB5xPYp", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in ~(Teacher<:Groups).Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8wZyjZtYcjyYSvc5X", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 14:59:46"} {"_id": "Yecd7ygLX24mL6Lrv", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some t : Teacher | t.(s.^Tutors)\n}", "derivationOf": "ytofFgiNnfsB9zsxg", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is s . ^ (this/Person <: Tutors) (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:15"} {"_id": "KDx2aupz9Q34aitWG", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher = Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iMQ3qs3Teyis9qoCd", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:37"} {"_id": "Tq3Rq9BmKt7wkia5s", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Student.(c.Groups) -> Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HFW58S7EnnuEs2qW9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:40:41"} {"_id": "3FhqcuC9WGdX86uLo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~Teaches.Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uGLDX4buEtWreMThm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:24:51"} {"_id": "x4Ma3Qiseu67a7NNh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {some Person.(Class.Groups) implies one Person.Teaches&Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rxLFRMm9btJn6i2k6", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 19:21:13"} {"_id": "eYdcGFESmyhhjGJ2E", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u4aF5xJwrbBhk8MTo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:32:38"} {"_id": "CN3gtbz2JTPKvYCNo", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "cMokxvBBsNWrJste6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:26"} {"_id": "ZW8yHbTyj3ofJpoJZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "ksboE28D3cfgeoSqE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:46:33"} {"_id": "rMb5yWSuyjTttzfGk", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c : Class | lone Teaches.c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (c in Teacher.Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BCwr8YTtjjXNQxs4G", "msg": "This expression failed to be typechecked line 85, column 18, filename=/tmp/alloy_heredoc2409876361964329598.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:12:34"} {"_id": "jyXGKva79F8BbRzZC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zuw6j3JZpzJ9u9XLM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:13:29"} {"_id": "ThXBgHDmZdc4eCe8H", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sGYiP5BLjAYaBtKYk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:18:15"} {"_id": "HCKhwJCnyub7WgwKS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | no Person.(c.Groups) or some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fr6ekT5irfeewZrdM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:47:06"} {"_id": "f48YHZvzTJiaR9E8B", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teacher <: Teaches.c => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eAQrX6a2QngbEWihC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:13:48"} {"_id": "YprsA3Xd5k5rciyJY", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRv28L838zakt6t22", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:04:34"} {"_id": "DoGxQf4tN6n46xtkW", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s: Student | Teacher in Teaches.Groups.(s->Group)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SF8ET2b6ApE4AZ6u4", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:02:07"} {"_id": "8a5cQARXvsv8SZSTa", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Person.Teacher in Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oinwPePP8ExdrcPiL", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:01"} {"_id": "gdWuELxQKarbprpix", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6jZPPutbZBbYZDLwm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:21:53"} {"_id": "cAXToy37ySZ6esoTN", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no Class \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x6CKyrzNnAisF9fNH", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:21:31"} {"_id": "rSCvnXJJ3xTaFkJRQ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all c : Class | c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9cRpp8smkme6ksYZ4", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:10:55"} {"_id": "mpNtC7vm5Er4SfkxK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3QMBWJEPF547hJBpP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-7 23:16:58"} {"_id": "BPurxnaXporWMJr5W", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t7YbjJe25KwNWLL4q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:00:47"} {"_id": "KX3fYDcbuzphDZiqe", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some Teaches \n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JSeuRpe29mHWWxNTi", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:37:40"} {"_id": "W4Ha6iae2Q5EhvBbW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some(s.^Tutors & Teacher)\n}", "derivationOf": "9i85j7df8WXdrWFPg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:46"} {"_id": "g6ewgvZkcQbCkbPvZ", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "A2xhxEchB3WYHQsD5", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 10:38:51"} {"_id": "vLMWMkXBBDrEbY8MC", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Person.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oamkMdjoFeBWQvkDW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:42"} {"_id": "q5xNCXZoYaqDFj6Ge", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Person, c : Class | some s.(c.Groups) implies (Teaches.c in Tutors.s)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BgADKchMPqNBktzK5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:30:45"} {"_id": "8uHrDZDBmFDLNMv3c", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hHRjYx9wYqccv3FMS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:00"} {"_id": "CAXx2Av8BHdqHR2SR", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, g:Group | (Student->g) in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uowbFWyHxD27n3smA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:29:06"} {"_id": "BygpMsh4oMJCC9mj6", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class, s:Student |some g:Group (c.Groups.(s->g) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "u57HoqR5axsrJ4xLr", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:55:54"} {"_id": "vhnQm2jcoMBwJ7eew", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t:Teacher | lone Teaches.c:>t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zyio8uTqWt5SX3AYs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 22:00:33"} {"_id": "zvn3e7Pm6NbbnNmNB", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person, c:Class| (some g :Group |c->p->g in Groups) implies all t:Person| t->c in Teaches \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "62gSSLveSJgkjNKWi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:12:32"} {"_id": "dpAhWgxrPBjkmKT4n", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tsome p :Person,g:Group | some Groups.(p->g) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qC6k69uZMfETgxKcM", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:41:25"} {"_id": "wQ4e3XwJXGokP4cTp", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups) = Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jEtMMP39hnWJmbKBk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:28:56"} {"_id": "QqePpCejtBQYS3hWe", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t : Teacher | lone t.Teaches + Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uZY9fHPFpPfeb9kbs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:02:19"} {"_id": "C3expcfyzH73dgqSm", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | lone Student.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3ZYQwcwbaheF3PaE9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:25:46"} {"_id": "pC4Q6mgHfA4qXNTSg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fu6WBT4c6jWAvvSw4", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:05:56"} {"_id": "vpjtjCZnT9eXTtW4k", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n ~((Groups.Group)) in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vYfY6pcgvJwSv3rWP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:53:35"} {"_id": "waNsixbwWoqTpwQy6", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone((c.~Teaches) & Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (c.Groups) ) implies some (( c.~Teaches) & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some ( p.^(~Tutors) & Teacher)\n \n}", "derivationOf": "jBDecqaY8CLaFE7SN", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 18:12:27"} {"_id": "LNEYb7rBNovt6rc2q", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HNDYb7rPZ45PaEous", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:22:09"} {"_id": "w3wfgaZEME7exmuoi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bZHCytLm42C2rvzZQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:00:38"} {"_id": "TqRYRpCENDcd5zXaA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zbfuG5EM9JYdyBQ8u", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:31"} {"_id": "iq9WRRQu95u6Ka9SH", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KqKCW38P2uKmv3ckA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:18"} {"_id": "gsBTs9bGtrryj22Ar", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches.c -> c.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pDXJGQ5Sd2e5Dq8va", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:03:29"} {"_id": "augdiDAjR3ervEHtW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all t : Teacher | some t.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "QeSmeK5wsjbsGE3zc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:54:50"} {"_id": "ZEyNjpdjsNfrjjbP2", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | (Teaches . c) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jRDtDfzbYLeKyWHmk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:50:15"} {"_id": "eTyAxEo2P36v6sCPc", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5sxSecaaH2GqtFp2z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:42:25"} {"_id": "HEciNDdaZ7RGdiR32", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tlone Teacher - (Student - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dkHQ2btYEyTE9a7GN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:51:55"} {"_id": "uPTsM2n6ZgsTK2WW9", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | one g : c.Groups | p in Student implies p-> g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t5NokTo4tZaQi96D6", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:07:58"} {"_id": "cRwEHJBsB44BR4AKz", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Jaz5oqPNGwTCvSYQ", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:31:21"} {"_id": "3tAdSERH5pnMB58wb", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | s in t.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5PJ3RhzBBo3CocKBT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:39:32"} {"_id": "PWnkt6nSsHcrnLq49", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EK3MnmQ6PgssvauE2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:34:47"} {"_id": "xo2bgPjNtEpp8RBC2", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5kLsnL5RggTEAyEbo", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:27:52"} {"_id": "i2Xzt4ZCCMPXiCLfu", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher.Tutors & Tutors.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "WGHFbDuCgswXCf7i6", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 10:02:30"} {"_id": "nGyQL6w4dhGdCsruC", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pej3aWi4d3qZTYWsK", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:59:11"} {"_id": "YzWKT6gdGywYjqQzd", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ru4Pf6SPTA9Tk6Y47", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:32:18"} {"_id": "5LFnjBGRexiZv3Kyb", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tall p:Person | not (p not in Student and p not in Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xQJmdSrWB6GiKya3L", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 11:39:06"} {"_id": "644EBnXESTGMAEaWC", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SYABscjWLvDp63vXe", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:10:28"} {"_id": "dWp84mJtEzpzzdfbQ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (Teacher.Teaches).c\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "irSGT3fpxCknJRNn4", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:06:47"} {"_id": "FHm9sCA5oKrsR6jGW", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 14:55:12"} {"_id": "wiNXWRre9HKMorvMZ", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all c : Class | some c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "57wdkcPFDwkMsrCuX", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:11:19"} {"_id": "mGoPWLMR9rx2qumx2", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rNJH9rE2j8eDu3Tdd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:06:27"} {"_id": "ndWAri4C2eP4WdveW", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QZrhxyJebb9dLMrbE", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:07:59"} {"_id": "GzMoHiYKpNroyFw68", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some Class.Group & Teaches.Class\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4dhhFCQxRMgGt3M4z", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:01:01"} {"_id": "z284aYwNPSyWsLkLE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | one s.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SYrqFqSS7AbkrXHpG", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 17:06:01"} {"_id": "uXFcpy72hAuWmyf9Z", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { Student.Person\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mceMJibq65WfQ93yc", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:34:23"} {"_id": "rnJovmou2jFe5WbAP", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lzvfn8u4mmsvBcsg2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:17:38"} {"_id": "wrba6TgDXXSdzSQ4F", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LnRmZDjs3KXHiE8Y6", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:51:29"} {"_id": "mCkzSdTHyPkMwXijJ", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DCpBsuM742MEW6uJQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:36:24"} {"_id": "fYXxBjZNNBui8X7Lh", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TuHhaqn2XvZRbWE9G", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:34:21"} {"_id": "GszX2gdZbHovtXw55", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DXP2Pw3SYLZTHjWjo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:15:40"} {"_id": "ofuER5iLKdxoB9kq2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some ((c.Groups.Group -> Teaches.c) :> Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vikJdEucYgEMLp3Px", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:07:01"} {"_id": "WDMQLm45QyK47Nu9S", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rjyHKwXtGmDSzmWsA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:43:55"} {"_id": "xBuH9DScJY2STXmRv", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher or Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wP3XGTWPSBoiGjNMw", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:36:02"} {"_id": "heoAotXiKeY9g75su", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Person | s in Teaches.c.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6xSvyaqPR4ZMrDnCG", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:28:26"} {"_id": "f5p3DfaAEQECrR2Kx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cFW3QWFb2L9qMhdvm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:07:29"} {"_id": "Y2oD8TijaCHvfcxX6", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n ~Groups.Groups in Class->iden and ~(Student<:Class.Groups).(Student<:Class.Groups) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gq6KaJTJspN5uiQ75", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:53:05"} {"_id": "NQ46brYMqSg3BRAth", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | lone c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "2NrwYC6cwxJGcTix8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:18:52"} {"_id": "qu567z46vdHBMb2B4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jThQ9rQXDyRRPnBPP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:05:31"} {"_id": "ACKTjAZ9Md7qHsYEm", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in ((Teaches . c) . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "7isFRvcSczFwSJiXT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:29"} {"_id": "gZsDeRJZT4Xmf9A7P", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wLrHXW2Dk6zr8o2Sv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:18:36"} {"_id": "RA5vuTfvufHHuLi8v", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "FtgTE7eJ75DvcNqi5", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:31:23"} {"_id": "7y393NTXZehHigoDk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c - Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p2kmfsnHehmAmw585", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:42:11"} {"_id": "k8oBb47bbheyNqhRq", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qjb9so5dtrbZoomjB", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:08:30"} {"_id": "hZTK8NjfgKQYpR8oC", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hi3gFeDA3ajnQttXW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:07:21"} {"_id": "6agtRQeYuvsgmYvP4", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutor in Teacher -> Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c: Class, p: c.Groups.Group, t: Teacher & Teaches.c | p -> t in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "diimAoBZ9JscFtdEL", "msg": "The name \"Tutor\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 17:12:14"} {"_id": "k8pz4avYFWoapSYDw", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pC4Q6mgHfA4qXNTSg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:06:10"} {"_id": "Fs6CJuEWmpm4BvTe4", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xvFhcM24xLyn787Ph", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:55:01"} {"_id": "sczFgF8Xb88wirKFC", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | s one->Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t4cT7okCjWezFtARz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 17:11:13"} {"_id": "NxKajSu5GfDfxKGSH", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student || Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nTAezo6fYJSNf3Bii", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:21:44"} {"_id": "X2Mf9kDSoeEijX7dt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t:Teacher| some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nGgJZrvDDZTTphNgS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:08:29"} {"_id": "h9FDemtvbQREzZkb5", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | some t.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xJA4kKxRjPy6uCQSs", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:51:56"} {"_id": "3uGy3WeofurJHNcyg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some c.Groups.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tj8nkMpFFxNmGddWE", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:37:48"} {"_id": "LkC9WcRwvSWDbB2qa", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FxD6x7rhADsqzdLMw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:58"} {"_id": "x3pHnCMgpistuQhP7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t3KTQunidourcopAD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:21:15"} {"_id": "ZuFuqLFTYGREjdCfK", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | (all t:Teacher)->(<:s.Group) in Teaches implies t->s in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "kH68Mp6xTYf2LRbHg", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:02:02"} {"_id": "nbwERPxNzsZcm6sGt", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno p:Person | p in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7nEzh4fopa4AtBWH3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-6-10 09:53:44"} {"_id": "RiSkbsnbqJTnEfmjr", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Person.~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "93YvGQxLhEt2WPxgY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 00:42:59"} {"_id": "RfCManG83AffKLzFQ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class<:Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EoxPAkeKXJ7PNf2Zw", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:22:22"} {"_id": "6pRdcd23j3R7WpSiP", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teachers)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BnXu6Y7KEAjWh4bqM", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:15:10"} {"_id": "AYoj7m3sHyEKiMNY6", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { one c:Class | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jMcp2RsApCaSqvPFT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 04:02:04"} {"_id": "pKugnH5AWNrcCQP6X", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c:Class | some (Teaches.c & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone (Teaches.c & Teacher)\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \tall s : Student, c : Class | s in c implies s in Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c:Class | some c.Groups implies some(Teaches.c & Teacher)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n\t(Tutors.Person in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cbk8J4aGuwwJWWjic", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 10:16:02"} {"_id": "x82FxYhi8s6ciAkya", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c : Class | c not in Teacher.Teaches => class.Groups = none \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7dHZBhP8TWf2TyKCG", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:13:08"} {"_id": "kxk55SRAmftkbxvhP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Student - c.Groups.Group) + (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iqTArNLBKcqJjJsRo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:48:37"} {"_id": "SYABscjWLvDp63vXe", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c.Groups.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D3N9CZZzgWnrum7GC", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:09:51"} {"_id": "xCkd83v4siDmPwDxm", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher or Person in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DctBdam2jWz6hKesB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 12:17:09"} {"_id": "KZRuJwyXGeFgGmwgo", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teacher & Teaches.c implies some s.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vSoFwcmjuZ6hafYgR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:28:05"} {"_id": "MxXySAd7juijznGaB", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tiden Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KbbhxdsXQuYmc3NRr", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:35:37"} {"_id": "Ap69HxDpQfXpEu8jK", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Person.Teacher & Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XYzmx5fAQumTTkzSN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:17"} {"_id": "fadRStrKGhuqycJzc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FdnwWNAXD82mjMeCX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:21:07"} {"_id": "vfAnFcAzciWkGAdrL", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tsome Student in Class.(Groups.Student) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8epjDZb43R8j5vajz", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:23:29"} {"_id": "ce4ncnbnjnq7ziBTf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some t :Teacher | t->c in Teaches and some c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vTbdkeQWqkmFun4HM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:52:04"} {"_id": "Kpvfng3risjiTjjrs", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ryRPYD4LZi77TaY83", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:44:42"} {"_id": "qt3KeWthFgKNjN465", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n iden & (Class->Class) in ~Teaches.Teaches\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9kByNASEwSLKnWBS8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:43:32"} {"_id": "v2pqbzuqwgESvhkvg", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Student + Teacher = none\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "52p3P2qj42cSyidNb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:00:46"} {"_id": "2M2ZiSy52mYmw3m9x", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all p : Person | p in Teacher implies p.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H27u5sa6cLNwWDi6f", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:12:13"} {"_id": "Gh9c82Lttv7MBd8jt", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Class | t1->c in teaches and t2->c in teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8qnDWyFMKWSQSDgRF", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-10 15:35:02"} {"_id": "M6Rvsd523K6D6sCYb", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g:Group, c:Class, s:Student | c->s->g in Groups implies t->c in Teaches\n\n}\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gQFmtJ2cdbxWD7QfP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:44:11"} {"_id": "Re93DEnETjGfwf6xT", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n some Teaches.Person\n \n \n\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "akHo3PYXxozBYNPnn", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 02:40:30"} {"_id": "AXMXLihWP4MBp4Jim", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teaches.c & Teacher implies c -> Person -> Group in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YRXAxPcKLdittgrZm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:36:11"} {"_id": "kubsD3YjPA3yvkhFn", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NjEK4tSMchDAwzuv5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:08:58"} {"_id": "PXfJgizzFrZMcd6mD", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-18 10:42:47"} {"_id": "i7Bruk9buRWYEsyFE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Class.Groups - c.Groups) -> (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "orakyk5etC3KfWizv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:50:13"} {"_id": "wPqy7CEW26KZDAGm6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "6ywMeAxLGGkCfuM96", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:29:55"} {"_id": "52p3P2qj42cSyidNb", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZrrnAERqmyPYg3q27", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-19 18:00:14"} {"_id": "wLTzT8g4DHo6cJJGD", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher & s . ^Tutors\n}", "derivationOf": "stDwpstHa4JcdwGKD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:19"} {"_id": "DTLnujaHNvSJqsj6B", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "GzKCSiwcGjDfDLy84", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:45:13"} {"_id": "ZZvMsMvpyiewXgbta", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some t:Teacher | Group in (c.(t.Teaches)).Group\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nW7ryo3cZZASroKqT", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is t . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:01:15"} {"_id": "CH2YbSWct8EGWAxGw", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "roH5DPqdAxJJiw9dy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:05:25"} {"_id": "mjtvN3aMuBpdfo67h", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\n\npred inv13 {\n Tutors.Person in Teacher and Person.Tutors in Student\n\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "hdkjJTWitPrPj47ci", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 00:38:01"} {"_id": "7F2cdcXMGdw5LWjGH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | some c.Groups.Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v23ri8qgFzJPJNLSZ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:50:17"} {"_id": "LhtbDctLTqxKCHCeb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sw7TztQbHwokozSFt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 15:20:45"} {"_id": "h5bWxW5QDtc8gPH4q", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some Teacher & ^Teacher.p\n}", "derivationOf": "Hkaed7EScvTyTxJTq", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:33:54"} {"_id": "cwGnYnHkcsG9sjEup", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wTBy2NwtKEQiWpkcm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:23"} {"_id": "mdE9szktc6NNJ7HgP", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Class.~Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4qS5JQsX4Wdv2fG4X", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:46:09"} {"_id": "xS8BFRLbAPPzZFsbQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s: Student | some g: Group | (s->g) in Class.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zhJ4QQ7a7jn8DrktY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:35:02"} {"_id": "k9AukqtSDvZSEdseG", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "XHjx9mjqP5RfrpS4f", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:57:44"} {"_id": "Nq3Mq5M82FgadM9pW", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups implies t.Teaches in c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mahecyh4NXTQA94XT", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:49:06"} {"_id": "BX2yjbhDHJDW6tMRT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | some (c.Groups &(Student->Group) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "wo4GLy2eikRPQZdRG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:54:23"} {"_id": "a3KCXBKYdzmLnKnzj", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teaches) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A4GFagMpsv4NL7MuL", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:37:14"} {"_id": "c9sPooG5PuNirKhnb", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student | s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7gQoNq4PjkpqDBjEh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:56:58"} {"_id": "ZCaPHGS2y4pqJaBzz", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall: c:Class, g:Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gQFmtJ2cdbxWD7QfP", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:33:36"} {"_id": "GZ638wBFfaHn8Cm38", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| some (Teaches.c & Person) and some g:Group, p:Person | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "MYPrAyc26KbooQFWX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:21:14"} {"_id": "RjEFDcegZwAfRxfWo", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teaches <: Teacher).(Teaches <: Teacher) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mg6nMk4xLY77zqJxt", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-4 15:31:09"} {"_id": "kvETL4fCs3NCGpjic", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => c.Group not in Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6GGWjjJ32bE92b7Rk", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 22:54:01"} {"_id": "f3dLM6PZhwsAuaeya", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DvCHZM2tEDYsggLwQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:35"} {"_id": "fgykmXMQoagxFZRo8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in ((Teaches.c).Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KmHJXYSZtzWcHQxjn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:30:59"} {"_id": "7oqBNFi2FiRBd8tyr", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some (Class in t.Teaches)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CLumi6xxhA8spRRbZ", "msg": "This expression failed to be typechecked line 70, column 20, filename=/tmp/alloy_heredoc17121598061394418664.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:51:51"} {"_id": "xa2wEMt7oGT5bkBCZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | all c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eLqLpKpJJnX9XPuu9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:37:38"} {"_id": "NNhFEA2qg4uPjz34H", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:37:43"} {"_id": "tvTgJzZ7GHSAFxF9G", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass & Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches.Class \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eSY9ftKL3uSYxD5uo", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:36:13"} {"_id": "BGrN6czAg4dqKQnkk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p: Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n not some s: Student, t: Teacher | s = t\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p in Student or p in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BT7M5Y8GidF9xxYbq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:34:07"} {"_id": "gryPNoFkmfSyMMBWJ", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class | all t: Teaches.c | some c->t->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "t92hB2v7jvhx6PFzF", "msg": "The name \"g\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:13:29"} {"_id": "tBRvyGFJXZbHW2idk", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 no Teacher\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:23:30"} {"_id": "9yhGMCZHiN9oZupcJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class<:Groups) implies Class.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "huc8qBZoimCzYp9pJ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:19:14"} {"_id": "Kc4KJGjJRSvCMqMJz", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all t : Teacher, s : Student | t.Tutors.s\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r8WHppv2nnch5QsRQ", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Tutors) (type = {this/Person})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:33:32"} {"_id": "i8NSApFdBTzy32Bkh", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "Xr5jzX2y7Q5J9yXS8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:41"} {"_id": "i2X52p76hwQujQmhc", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zTfQnzF3aSwMji46s", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:17:44"} {"_id": "jNhX7QDsvDx4TZeD6", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in (Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TeDH5QDXyCWjDukyF", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:50:18"} {"_id": "H69jKNxGWgNHyKuhT", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "3LdhFpf9gto2oX8vB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:29"} {"_id": "fCyTnp7zStautJQgi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Teacher = none\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vjuNercXusQHKx4HD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 17:58:10"} {"_id": "rLFLmMECTys284uBY", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WnE62MgoYF8Dged9Z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 15:58:02"} {"_id": "uXKZFmjNKGCDxaDyX", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rSGC8nyKqfiAGxrs6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:14:30"} {"_id": "FTzFoDuGpkkt2siW2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "skNign8hDPNpgtLdC", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:22:02"} {"_id": "R6batN6oGxP3cs74y", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vS5hY6SX42ReHxR2L", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:11:31"} {"_id": "xKQs2HGB3CrZjkGgP", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n Teaches.Class = Teacher\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GPs9aLoKDJT7ACRoJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:10:23"} {"_id": "ttfyqjt4PHENhKniu", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | c.Groups->s in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ls8enoWKzo6tZf8Mw", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group->this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:22:55"} {"_id": "AAREZ7akeRouk2XsX", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeaches.Class & Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JpXxSgF4bSBEfMg5Y", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:25:04"} {"_id": "XbpiGqS8DRq8J4eSE", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nPerson.Tutors in Student and Tutors.Person in Teacher\n} \n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person some ^Tutors.p & Teacher\n\n}", "derivationOf": "Mx7CwKJJeAiwBpPri", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-19 21:21:45"} {"_id": "m79PpeQeSv9ShdBrz", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x:Class, p:Student| some g:Group | some (x.Groups).p.g\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dQkPoJXdwoZPyuHTx", "msg": "This cannot be a legal relational join where\nleft hand side is x . (this/Class <: Groups) . p (type = {none})\nright hand side is g (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:25:36"} {"_id": "QcSramFKoRTjLRDsn", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dfnWrfcvxCRPJZZea", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 19:59:55"} {"_id": "dScgrpJyDcvgTTk6x", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \tlone Teacher & Teaches.Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AcK5EgYYouWKytG4D", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:07:08"} {"_id": "BYGJ2syRqQqmByEkw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {some Class.Groups implies some Class.~Teaches & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hMb2mxNbxN2NsPp6m", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 19:27:03"} {"_id": "7agyWb79u7PrcNBuh", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = (Teaches.Person) -> Group.~((Person.Teaches).Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hGkzBhS2NXLZAK9FZ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:52:49"} {"_id": "pD6miA72ojsKAbDiS", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {all p:Person | p.Tutors in Student and Tutors.p in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "ng28ASh6DGAuzpprb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:42:41"} {"_id": "tj8nkMpFFxNmGddWE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some s.c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fa7ay7kFpNazJxmQX", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:37:12"} {"_id": "x8o5CMTWrC6JYdpuq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s:Student, c:class, t:Teacher | some g:Group | c->s->g in Groups and t->c in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E9RxQQXJhECP9Jp4B", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:27:29"} {"_id": "6bgW6TghsXibYMMuh", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => some Teaches.c\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2kopGxA353ZXXFmNb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:19:50"} {"_id": "BwZu3jPMMmntvjgsX", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \t\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HZNqnKHEX8KEtNYmB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:28:19"} {"_id": "bPgQzeRH5xcXq4Yue", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R3jnTZAELSk3gcgjS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:29:43"} {"_id": "safgMXXW9R2MveuLQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person & Student ) & (Person & Teacher))\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DWYqEdtoykBjppgWQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:30:19"} {"_id": "bY795kcEBFW7aPSPK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \nStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QQYduDSQXe6fz2jCK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-13 03:23:07"} {"_id": "pGkZXRYLY7YJ44aYf", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n Student in Class.Groups.Group\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YjFFPCJm2x9B9EZvw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 21:46:20"} {"_id": "pKG9voZDFNwKrt2EH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tall t:Teacher { some c:Class | t.Teaches in c}\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8sPB3s2iaJhLEFSnY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:49:41"} {"_id": "b7SrEtgBaat8rTP7j", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "vrLGaC4ceRY9ZkNkg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:48"} {"_id": "YZJ3gnvc9x2nhhWzd", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teacher <: Person.Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fEdNcMmsPh4cen7av", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:24:56"} {"_id": "3Daq8GjWd9p5sZhyA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tno Student & Teacher and \n \tall t:Teacher { some t.Teaches}\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xTjcXtjigPvyoRmM8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:47:42"} {"_id": "A3FPhx5is8sMC7rnC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c) -> (Class.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZRQWs8HTxF6aHTZKB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:31:43"} {"_id": "uWA96w2WRBy46cr9F", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tall p : Person | p in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eCHAQYnY677oXZwWt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:19:49"} {"_id": "NsnfwNviymECT2735", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone((c.~Teaches) & Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (c.Group) ) implies (some( c.~Teaches & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "L3rnciancwDRPSC67", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 17:52:24"} {"_id": "z5vmQMkEsyLuDs8ph", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "82K6MYAugMFd7Gv5j", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 16:23:57"} {"_id": "r9Z5TENNnEqP7iWGk", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t(^Tutors).Person & Teacher\n}", "derivationOf": "fGSG7jzicuDNy8mjH", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:33:50"} {"_id": "5v3k6ghKk5PoozWCS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) => (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u2wDpBctjZw8WKXde", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:35:47"} {"_id": "ph2mSoS24X4PgnJR6", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Person, s: Student | t.Tutors in Person and t in Teacher and t->s in Tutors\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EwRueX9yK5A4D73AA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:33:39"} {"_id": "GwcwvNZx4iNBwenMk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone ((c.Teaches) - Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8sEeuFhqt5wfDRRQv", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:45:16"} {"_id": "K44QrDe6RrKrNb7fu", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n all c : Class | one s:Student | one g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies c in Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MnPqr2nRmQkA9TDXD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 19:58:19"} {"_id": "EgjkdFXcYuDtFoWGL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some s : Teacher | some c.Groups, => s.Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "qfdQa8S8gwkGSyz8P", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:41:44"} {"_id": "hXTEPhtPR5xMqokRn", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tfor p in Person | (p.*Tutors) in Teacher\n}", "derivationOf": "tf7JbFqFNZbt32FFe", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:11:09"} {"_id": "mKrZ9BaLf8etkLnmR", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some t.Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rGwGsT4ZgAAb7cwsX", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 16:23:23"} {"_id": "uGC9toPAzLcKg6549", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fmEQKckmPRXCMKKgE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:48:18"} {"_id": "iJytLboTiiwXqEiKn", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class, all s: Student | some (s.c.Groups)\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "jXwmTZwjukXWESqS4", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:39:02"} {"_id": "QMbCrK9yJvx6m5Kj5", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Class in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "596rGGDrT9KM5enfM", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:30:00"} {"_id": "5H3dYGCDbQNaoDwhK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.(c.Groups).(Teacher<:Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ChTnNkuPhznPcANdA", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Group}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:12:20"} {"_id": "XNDNHtcpQKoq4y92j", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t <: Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Tutors | Teacher.t.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Bgoxdrz3zLKKifwy", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . t (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:42:57"} {"_id": "YyDda5i5MZg6LPNxv", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fnH5QME9R6RGShren", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:34:27"} {"_id": "3k62NLxyEQXrXsucM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ugisii36PufLxFSDD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:09:51"} {"_id": "swADhDAty2QCrkakH", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, | Teacher->c not in Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2md8tPxS6q7NjzcQx", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:54:00"} {"_id": "F4gAThHCERBDTjo2X", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | (some Teacher) in p.^Tutors\n}", "derivationOf": "m2e7hBDSTQGFgssKF", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:51:38"} {"_id": "8C4Dade4vPjNjD6KR", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in Student.(Teacher:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iMNQpDbf9srCaw92J", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:20:10"} {"_id": "6kqWHbak5nQjsnJvg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class | all s : Student | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GCuG8YcLcaa4WXJbn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:08:30"} {"_id": "Bxu6quv7HRuaQYRp2", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GHPspApq8n2m3HXSq", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 17:00:39"} {"_id": "RzcqN8mKuPPm3FQBW", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student || Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uKhoe3HaeGgxneo3t", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-30 01:16:24"} {"_id": "aKmwkbPZYqx9TwcAK", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tTeacher in ^Tutors\n}", "derivationOf": "MdhyMEobjzJrb7x2j", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 22:46:36"} {"_id": "QPTtJ9fZMH25b4rHE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zGJA65pDEPKGDXZgK", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:00:02"} {"_id": "4vXDrf63pEzW7Diys", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and some Teacher:>Teaches implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D4BMkBaxnndEssBnv", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:22:50"} {"_id": "p6N7gDFtKmrTt5FZk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student+Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qv3ScWaKNfazi6eYa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-13 03:43:07"} {"_id": "gus2DAgGrvZ69ippN", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Teacher+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher->Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JiqmepQcdntZEKNwF", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:27:57"} {"_id": "7otzpgEDSfScasXEL", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "pD6miA72ojsKAbDiS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:44:02"} {"_id": "BhzXQirP6s92pHySu", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SRjSr5uHaAuxF8Dts", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:09:06"} {"_id": "wxnCAHE9o4qJCqraZ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xq7pmuW2zp5DqwvTt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 23:57:36"} {"_id": "AEdGkFWzjJt6ETrKM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Person - c.Groups.Group) + (Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7XFvYbh3jyoTq555H", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:48:14"} {"_id": "XzaJ3oNjrYcicknPN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teacher & Teaches.c implies (Tutors.s in ( Teacher & Teaches.c)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z6ZjpaSwFmqDWDWYD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:35:41"} {"_id": "AfScBB9ygoNL8EaTf", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p: Person | some ^Tutors.p & Teacher\n}", "derivationOf": "8p7r7h3qeQ9N93E6x", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 23:10:40"} {"_id": "GPMFfFPTLsiRgeYq3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups) in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PoetgL4K7LKJAei8K", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:31:02"} {"_id": "TGr9obvuzaNXxiDkm", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome g:Group | some (Class.Groups.g & Teaches.Class)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "grE6dR4kjmnguF62r", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:56:45"} {"_id": "gwutZAmPDhdv53HFr", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches & Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "tXc7CdcJ9eZJ6EaRx", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:02:06"} {"_id": "hGkzBhS2NXLZAK9FZ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = (Teches.Person) -> Group.~((Person.Teaches).Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lez8kNpPHmWm2JyjW", "msg": "The name \"Teches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:52:45"} {"_id": "2PEgKn35A5p9Ciu3d", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, s : Student | s->c in Groups z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jhbLsXPgErxMzcqe5", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:21:14"} {"_id": "2LA7pyP57om6dQR49", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s in <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "8jTTKoMcQ26Dwgag8", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:06:22"} {"_id": "CDBbdqakryNAt2Xyo", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | #c.Groups.Teacher > 0 => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YaJXFuKZmK96YKxCS", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:37:41"} {"_id": "nHtgm7t46Hyi3eMbR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student - Teacher & Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EzCrpTS5r4XKqWTSJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:53:14"} {"_id": "MQu52dwYq7Ev7qhs9", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s: Student | some g: Group | Teaches.Groups.(s->g) in Teacher\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JnLtdFgBe52GBuATS", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:04:10"} {"_id": "mDDbnHbWokKcwcJP7", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | inv5\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E43vukgS2oE3vhj4p", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:04:50"} {"_id": "NKfABFtuD8ZoapKSJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some ((c.Groups) -> Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tq3Rq9BmKt7wkia5s", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:41:02"} {"_id": "XdkJ8xMyE525FZ8XR", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z2idsnsbPFdMJJtWT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:18:31"} {"_id": "SLCXYNNuMtqHpbkQM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GvkLmLLor9dY2AxKw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:43:01"} {"_id": "CxMPDEeXpbZWuRZ7N", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { Person in (Teacher or Student) \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { all p : Person | p in Teacher or p in Student) \n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zrNW8LBLq5L9G4sGA", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:48:21"} {"_id": "NPeeEMLwFEZh6B9oK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all x : Person | x not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all x,y : Person | x in Student and y in Teacher implies x not in Teacher and y not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all x : Person | x not in Student implies x in Teacher\n}\n\n\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:55:27"} {"_id": "eAQrX6a2QngbEWihC", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teacher <: Teaches.c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iodH4t7HohApFXrDR", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 23:13:44"} {"_id": "FogKTLetoyR25u2Kp", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class | Student in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "39N4cxB9MbpwkSdnm", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:28:49"} {"_id": "xp2i6iQERojvEsTFA", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Class = Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sraTzdHLZy8Nh8fMo", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:25:23"} {"_id": "SxDKf6j5EM3FqBqj5", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson & Teacher = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:08:33"} {"_id": "4SCND5uHu2DoiBdgD", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c.Groups in c.Student->c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RqSRgLCkTrB8JXdtR", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:22:57"} {"_id": "5Yn6YTgg8HttTticR", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Group | (all t : (Teacher <: Teaches.c) | t->s Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "2KJuad7CfWhw66A4w", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 00:41:30"} {"_id": "a4b5nCPJPmRALgX8e", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TLoh5Rus8rWiXXDSZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:21:02"} {"_id": "6gxevmiyS8TKDbu9W", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ocWZPcKYt7NM8o9Mh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-8 16:54:27"} {"_id": "QgEzarmMXKB6nj6EN", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HPhpZsA2qRjh4LZ2z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:20:59"} {"_id": "zA2DJXcNiuQ6KYc5G", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | Student->c.Groups in c\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "koCWxkhAfKhfdSp8P", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:29:48"} {"_id": "TNcnot8GyNZEgTAty", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { no Teacher\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 11:50:56"} {"_id": "tt5Cu7Yyg6tgupui2", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { one Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p3GT9xd9ezoJ6a23q", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:55:42"} {"_id": "ZYwtDB9YNaqd78Jhm", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | (t->c + t->c1) in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | (t->c + t->c1) in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QcrB7A6wZ92bGi8Z2", "msg": "The name \"c1\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:27:45"} {"_id": "xkeZj7E4xFKPX4H2k", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "zf64ekryZRD4JmBAJ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:00:44"} {"_id": "bvcqtmzjR5ybgS3on", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n (Student . Class . Groups) = Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DcZ8qBFRKtYf3SAaJ", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:09:17"} {"_id": "L6WBWyk2mFukupDwk", "cmd_i": 1, "code": "sig Name, Adrr {}\nsig Book {\n addr: Name -> Addr\n }\n\npred show {}\nrun show for 3 but 1 Book", "derivationOf": "sCTziLwbfKKHkgwbf", "msg": "The name \"Addr\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:25:46"} {"_id": "dCmsZ5WtduEhbTdZN", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some c->t\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5yJyJohYvE5xGDYNM", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:33:09"} {"_id": "PoxuBJNzoQ6hPjMvQ", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & (Teaches.c in Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8PMdEFMraWusb7kfn", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:18:11"} {"_id": "uR3hKeCyYyurG45q2", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | (some Teaches.c in Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kWrfvYpAy4tGjzBE6", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 14:48:01"} {"_id": "e65vfBE5RET5EW2oB", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2xLAC3fbo5wWQZNmM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 20:48:55"} {"_id": "9vDgxJTJxiEksg3Da", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3YwMNXdDGQCXz5Mf2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:56:49"} {"_id": "DMSRQg6AtbBA62KKa", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Tutors\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cBaevy4zbaoTpG8Qv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:45:55"} {"_id": "wwEGdbzNMmXz7vepf", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "a9MF9Csaqn6Covobp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:56:45"} {"_id": "6z75tktbFM2iFzy7F", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uXKZFmjNKGCDxaDyX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:16:24"} {"_id": "hqp4WAiBd9o3gAz7z", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "KSPAiuBoYRmAcCNkS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:11:57"} {"_id": "ziWvRdHhEcHohMjWL", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qgsEycWXEDKK26HYw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 15:33:48"} {"_id": "RoCeZqEd8p2pCK8xp", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no ( Class - Groups.(s->g )) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wD8eaT4dPXi27tzdo", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:20:21"} {"_id": "mPizbaEFLeg9EDmQ5", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zJX2dsAkMLSNdSWr4", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 200.765625, "y": 199.1999969482422}, "Class1": {"x": 401.53125, "y": 199.1999969482422}, "Class2": {"x": 602.296875, "y": 199.1999969482422}, "Group0": {"x": 200.765625, "y": 298.7999954223633}, "Group1": {"x": 401.53125, "y": 298.7999954223633}, "Group2": {"x": 602.296875, "y": 298.7999954223633}, "Person": {"x": 401.53125, "y": 99.5999984741211}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-2 15:13:22"} {"_id": "Wwj849zZvhp5RLWXz", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all c:Class, g:Group | some ~Teaches&Teacher.c \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tYNf4TybDKG8prY7g", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:09:45"} {"_id": "buwTLsNr6zjxspNGq", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L54c8i4L8bq4sF3hR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 18:37:08"} {"_id": "FbCuXJFr7bPrhxDac", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tone p: Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PwBfnT3bpqTMzA9Lu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:03:06"} {"_id": "diH6uRbss7sXQ4xYh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "whe5EBeSmusqh8W3n", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:50"} {"_id": "vYLZSD44G4x9MfEhJ", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xyZreyoa7FysaRQSM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:35:07"} {"_id": "pqJMpR33j6N6vEYf5", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tall g : Class.Groups | some g in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fyC36XxZsbedMHEHY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 09:56:41"} {"_id": "Ctsc6Er28AagES6Xf", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X2oTZiRhxZZmdjm5n", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:08:57"} {"_id": "cBvxuLKwbqxnKaEmw", "cmd_i": 8, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | (lone Teaches.c) in Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "KrpyJAXvPCMESp5SA", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:15:44"} {"_id": "f9vH6EFHhSx8EH5iP", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "GqeSnrT8CrPFTPtAQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:56:22"} {"_id": "Boss77mnyLxTAN8Ww", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ((t.Teaches) & ((Groups.Person).Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "RgyHTgMgumYW6Zgxx", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:03:59"} {"_id": "8KfXbpKEG7ZHhzGhp", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups .* Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "btTkZWih58omRxYFc", "msg": "* can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:00:32"} {"_id": "rHzdroGPTpxyYLdLt", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tjDFvGpuy6wkRj6j7", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:24:07"} {"_id": "ALToRHfCQYHwcSsfG", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n no Student.Tutors and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8RdjCuSaamzLa6NcH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:02:00"} {"_id": "BDKqS7deDXAMpCGoA", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->Teaches->c\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SMSMbJ7CJxGffdeHh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:40:49"} {"_id": "Nwv3sjnv93inQqrd9", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p:Person, g: Group | p in Student implies p->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ys3LMXgA6RuxbSbBx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 17:25:07"} {"_id": "LBNZdXFF7G3epE9BJ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | Teacher.Teaches.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mTvPq5z6oQWa4vpFS", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:28:50"} {"_id": "JFCNstfLMxmh9DGFx", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YT4c6ivkD4FwJogiq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:25:08"} {"_id": "ufZHjKWfnFynbPaa7", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = no Student + Teacher\n Person = Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BNLqpadNHgjefEEw4", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:27:03"} {"_id": "BBYLLQhrPyWkxs7Li", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Class | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mSrmKhwAJRo9mgWDp", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:05:08"} {"_id": "kagTZtiAztwbP9eST", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xoab47QXbqqDik2uv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:03:31"} {"_id": "HLnbyiP38ATkD9pFN", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student || p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GztMKhP7yFhdQuMN6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:43:41"} {"_id": "DMYNd4vHx4WP99KtJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person,c:Class | some (c<:Groups.s) implies (all t:Person | some Teaches.c:>t implies Tutors.s:>t)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5TgWjqpSXaDP49hcJ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:27:08"} {"_id": "cdKAqM4PjqFoM2kXJ", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher | t->p in Tutors => t in Teacher & p in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bwigjmzCLK9gSyTTW", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:43:16"} {"_id": "HDKcQ4JRbZaNhHE7H", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QcSramFKoRTjLRDsn", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 20:00:34"} {"_id": "NNC4YdnFrrxd2vTha", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yeg6LQGt4PR7MYhhk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:48"} {"_id": "Rkug9LivH2S2WwiDg", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t~(Teacher.Teaches) = Teacher\n\t\npred inv7 {\n\tall c:Class | Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GYj5SK4hnxL7h3tbP", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 14:01:14"} {"_id": "CqBwq9trt2AEvBfM3", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8G9LWeaXoS5WgMCtw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:26:17"} {"_id": "GoDabTegrTR7Q7NLH", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nLHEDH8XSP2x8oAgP", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:57:03"} {"_id": "asD62ddoG4M3hpAwp", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JhFn5npr4wuu7obtf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 15:21:46"} {"_id": "N5gG8FuKtf8bCdZDL", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no (t.Teaches - Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3ffipLgbi4xpemLyD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:55:03"} {"_id": "SBtXidYhbmaXysLem", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \tlone (Teacher & Teaches.Class)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dScgrpJyDcvgTTk6x", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:07:15"} {"_id": "tidTME6HJ7c2kwDiB", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Tutors.p implies (Teacher in ^Tutors.p)\n}", "derivationOf": "fHs7nkusqo6wdhqh5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:15:41"} {"_id": "KHcFryWfuqRJWCett", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YP25M5k9harx6S4BP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:08:15"} {"_id": "uKJpfDnCTvLPmJzuE", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c:Class | some p:Person | some g:Group | some t:Teacher c->p->g in Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h2qo3SesrfRhywTpi", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:11:16"} {"_id": "4N2TFZx89P2uPqBbZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "xkeZj7E4xFKPX4H2k", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:00:51"} {"_id": "2bC2ArzqARbhZ9qg8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => (c->Person->Group not in Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vLZAQSMGfhyWkSujD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:09:56"} {"_id": "a77iQnhNecRuB8uwb", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teacher & Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KLdRasQMfjaHE5ac6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:43:16"} {"_id": "SbgfWkbs7guk836zW", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m9XM9DArMYPJork6x", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 10:05:21"} {"_id": "5vxnphzJT969Fhwn8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in (Teaches.c & Tutors.Student)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n49Cd3yaw7NP96siQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:28:13"} {"_id": "SrKbtSyPkb9oGbfEj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some Groups.c implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "Si9Bon9PkwC9nda3B", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:23:03"} {"_id": "zuNH5Y98eGbNbZbBf", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n no (Student.Tutors) and no (Tutors -> Teacher)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "vELywhkteuTcyA9kC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:29:14"} {"_id": "gcQpJuH7NzvGKo3iZ", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \t\n all c : Class | teaches.c in Teacher \n \t\t\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \t all t : Teacher | some t.Teaches\n\n \n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "YdBpYZc79NDKcKGbo", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 19:24:46"} {"_id": "T6uf6z2QGjW6GCgpR", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in p.^~Teaches\n}", "derivationOf": "RMb9QsfLqcjWwWrBm", "msg": "^ ~ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-10 15:37:01"} {"_id": "qnxyu7R5W48bktkkJ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.(Groups.Group.Person) & Teacher = Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2KmwvuDuht3i2hr2g", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:59:01"} {"_id": "x97Tpj9a9WceRufPM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BGCug4MCuA8NQbRCZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 19:29:35"} {"_id": "dsWvMdLLby4CKsrf3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in (Teaches . c . Tutors) & Student\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "m7AwhSdw5xMsdYCSZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:49:44"} {"_id": "R5iutxmqhTzhxGkHQ", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tfor p in Person | (p.*Tutors) in Teacher\n}", "derivationOf": "hXTEPhtPR5xMqokRn", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:11:15"} {"_id": "moHCmCMKAq7KfC5bh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4cTKXoMF6KdaWsPwB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 15:01:35"} {"_id": "i2jpPiRvghAomKu8t", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person-Teacher) and no (Person-Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H2PoAcoeWmTRdRPp9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 20:50:31"} {"_id": "Kw2awjETCCevkxShe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bc6GBZEbYxWMAD7e2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:08:26"} {"_id": "nwKpQBjuX85McjHx5", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all c: Class, s:Person| s in c.Groups.Group implies Teaches.c in Tutors.s \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "r6yWec79qR3ti3stR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-18 11:51:35"} {"_id": "psgQMpP86p2bhgf24", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s: Student, t: Teacher | some c: Class | all Groups.t implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XW529qZ3NXsDMWFq7", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:02:45"} {"_id": "pTDPgz4pE7RobnyEJ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups) in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wQ4e3XwJXGokP4cTp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:29:33"} {"_id": "X6bxTHCGbqXLtmmpL", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vMsFKMpt48fnt5W85", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:21:08"} {"_id": "XNtNjk7iqWNFqZWRu", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | some c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "mnmMdTjK3KKCcj58n", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:40:01"} {"_id": "S2Em2atvrBAiwDEJQ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t : Teacher | t in Teacher.(^Teaches)\n}", "derivationOf": "2CvGxYfRKkE3hX7av", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:15:29"} {"_id": "mSeJpYANqp2MLGj2g", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:37:26"} {"_id": "3e58SXdWcacmpoecY", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "muEwSn9xumbgBWTLL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 18:29:06"} {"_id": "mTz2v926SXfdEKgXi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t Student in Class.Groups.Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WTLSA3XLbgARyrfCd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:40:34"} {"_id": "W2aksvTNPX9QiPttH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some t : Teacher | p->t in ^Tutors\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:28:41"} {"_id": "pdK7kTXS2D2LofMbB", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \tall c : Class, s : Student |\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s : Student, t : Teacher | no Student.Tutors and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9YnbLqBDPFxFfEG5e", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 320.6333312988281, "y": 199.20001220703125}, "Class1": {"x": 641.2666625976562, "y": 199.20001220703125}, "Class2": {"x": 961.8999938964844, "y": 199.20001220703125}, "Group": {"x": 641.2666625976562, "y": 298.8000183105469}, "Person": {"x": 641.2666625976562, "y": 99.60000610351562}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-2 17:08:09"} {"_id": "m76yrXb83JFKMnAcb", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutors.Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6a6cFpEzPABH6vnDc", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:03:43"} {"_id": "q9ZFysGHcNdaNNpym", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher<:Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "BWtNsjfriY8L6Dw8S", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:01:52"} {"_id": "wv3g8DZbTt8ai8YYq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).Teacher\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HS6Z6eDyH72iGHQ3e", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:14:07"} {"_id": "F4WDSLMQ5Ruzc2XFr", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groupos\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eoDz4rLRSzPkK2cLD", "msg": "The name \"Groupos\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:42:03"} {"_id": "NJWR3up8gKFZSGqYm", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XBqDTojjr7c9wZs7B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:03:04"} {"_id": "tLcnmzd2gX32Amxhm", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | (Student.(c.Groups) & Group) = Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "usoD4WnhhgRQZADW4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:37:29"} {"_id": "REcoAz8xAf4M2Zjrd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t some Class.Groups iff some t:Teacher| Class in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ae7zFJWo2yFgftWhz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:45:35"} {"_id": "muEwSn9xumbgBWTLL", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dPuhrza3ipbNKXfw6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 18:26:38"} {"_id": "zgRKw8RaaxMbhai4H", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Person\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "in3yivtrtezvY8dit", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 16:54:40"} {"_id": "rWGoK4QjZxPeNi5pm", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone Class.t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S4ycuxNicSrLZAqKR", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:13:07"} {"_id": "YFxTd5TT9y3jeoSrF", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | some Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JaC2bhnjBoruyosM8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:09:04"} {"_id": "Cqz2ukBstFLLP3eXB", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XwiGQMfWQg9CEH7Dp", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 485.5555826822917, "y": 265.55556233723956}, "Class1": {"x": 242.77779134114581, "y": 265.55556233723956}, "Group": {"x": 242.77779134114581, "y": 132.77778116861978}, "Person": {"x": 485.5555826822917, "y": 132.77778116861978}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-8 21:52:43"} {"_id": "GCpHhris4nqfRA4vT", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | all t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ik2wwzEQLWuveGYXR", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:51:04"} {"_id": "nz7knSSwfeMnFSmN7", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\t\n\npred inv6 {\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.~Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TMbFtbXBBAovi5jHY", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:36:45"} {"_id": "uPMLtqKfdGqz4Cy3M", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cLWkiQAtCFdk5Gjsh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:50:38"} {"_id": "p9TnWjj7yppiHhJrF", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall t : Teacher | some (t.Teaches).Class\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PJ7nRqWZtJc5LgwRj", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:59:50"} {"_id": "dwaotpWH2wN9N25kR", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NjDDgHNrD88K4rukS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:50:27"} {"_id": "oRxHM69M9F7RGtyWP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in Class.Groups implies ((Teaches.c & Teacher) in (Teaches.Class & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TRjvu6MTcRqk4tWdW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:52:09"} {"_id": "RayGWpvaHs3jteyzX", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno(Student & Person.Tutors) and no (Teacher & Person.Tutors)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ni9aYRqKzf7R862se", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 18:39:27"} {"_id": "8QG6tRLJngLNdgQsR", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some ((Teacher.Teaches) -> c)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "Rnq6oXG3MpZTDvmcY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:38:57"} {"_id": "YbdRrJxipEehMLjH5", "cmd_i": 0, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location, Name {}\n\n\npred uniqueOriginDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\npred stopMustServeAtLeastOneBusLine(){ all s: Stop | some b: BusLine | s in b.stop }\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\npred show { uniqueOriginDestination and stopMustServeAtLeastOneBusLine and locationHasAtLeastOneStop }\n\nrun show", "derivationOf": "Sv3iicSd3CZb9wsPF", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 20:20:05"} {"_id": "8RdjCuSaamzLa6NcH", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n no Students.Tutors and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DTvPvFQrJCN5rrmEe", "msg": "The name \"Students\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:01:52"} {"_id": "xaoSeYrTww6wcExAk", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | Class.t.g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bm3QMupAFsAfv4SoS", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:54:36"} {"_id": "YzHN6iSwsv8GjfHku", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TqRYRpCENDcd5zXaA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:29"} {"_id": "dGBhWFDmNpX6Xf9SY", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | one t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "nX792mizTBWboFvXB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:30:09"} {"_id": "zebvxapGjLTXoYpBi", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DEEikMPr8DRkDjmZx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:42:03"} {"_id": "zHLgp6mJKPykEFNRS", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j6KBCZZ97Fqbo6NXE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 18:58:16"} {"_id": "TJtJguACu6EKR3X97", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \tall p: Person | p not in Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iNbHBWRGkqY8pyaAr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:58:01"} {"_id": "ZxQt5ZyJqtALz9TJ8", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t.c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fd4JGYF7dtQSqKBXY", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:37:10"} {"_id": "nt6YvqGAXYQRMGcA3", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.~Teaches in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w2eMo3SY4wWqFPNnE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:32:20"} {"_id": "JYFAGjtos9impqiwh", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kFRAo7zootSnRHsvA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:53:26"} {"_id": "n4HXiWQTt43jgQ5DG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, t : Teaches.c | all s : Student | some g : Group | c->s->g in Groups => s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "k5nvNhDqjDxHy8ceM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:35:33"} {"_id": "qEpK5SG4D95xKLW9y", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Groups implies some (Teacher->c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NjwxgPthhrphxbBQj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:00:25"} {"_id": "M8yeBd7P5Q2SH3dsf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches.c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f48YHZvzTJiaR9E8B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:13:58"} {"_id": "WW3hhGNdKmtETE2nk", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "wcsNEKN7nhQx5fdeg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 22:49:50"} {"_id": "tfeCh9ubgSaBxhPgu", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (Tutors.t).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "HswJcmBwm2aNLYnQx", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Tutors) . t (type = {this/Person})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 10:01:55"} {"_id": "6HqPih7LcjT8fHCzA", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kZpHRYZfGJeyGXsif", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:12:00"} {"_id": "GWCEkoCyTmchMvKLi", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Teachers = Teachers\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sD4bXoGmzFDfLmdXK", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:28:20"} {"_id": "Gny6KFC8A9Lbs8Bpu", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-27 11:02:24"} {"_id": "bc8iqoauH44Lh6WBR", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.Groups.Group.Person in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hXyQTiF7i8kCw3vZ5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:55:38"} {"_id": "vevy8tk49KMbt7Dcj", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MJeiddY8H56g7FRwT", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:55:41"} {"_id": "FKrnA4o5Xr6tCodhM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nh3vGoKHnP4mFLASR", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:49:33"} {"_id": "YL7mrpsFe8aiRbWKw", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches.~Teaches) :> (Teacher,Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Kmnr6ekJAufxgyb5", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 15:23:57"} {"_id": "fYJmyB3s9mSFffqPW", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).(~Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DFnkbBdzWdHRZo5KT", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:35:08"} {"_id": "tehH5MeETDQnqCLkp", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teacher in ~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pyNbiEkTYuDmaxTeh", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:37:15"} {"_id": "xe4kTXqd7LxQR6ZLu", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tqarMXxXEv9p3CGgE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 16:07:02"} {"_id": "uHT6ACMBfeLQsM5EJ", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person -> p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K2N2zRwhpYEWwP4MQ", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 15:19:33"} {"_id": "x5Hm9eRW6KZjTcDTy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WfvLiZxynLrR6HLAk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:58"} {"_id": "qfdQa8S8gwkGSyz8P", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups => some s : Teacher | s.Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This cannot be a legal relational join where\nleft hand side is s . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:40:52"} {"_id": "3uHsfuaEftcRSpchj", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pA77MGS66YEoxWv4R", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:00:40"} {"_id": "DEEikMPr8DRkDjmZx", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | c.Groups iff | c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ti2sW2qCmcdKzsfyZ", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:41:44"} {"_id": "xQF9m48KHaikz3CPt", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "bqsRCSZ77Jreurv2f", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 10:40:18"} {"_id": "tT9saDaEiqFjx9dh9", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teaches.Class in Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PwgZBS8Zs9CPdzHu3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:56:29"} {"_id": "KrBCGq8EbDDvEE48f", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches.c) => (c->Student->Group not in Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M8yeBd7P5Q2SH3dsf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:14:23"} {"_id": "zAm2ivGajJbh9Lf6B", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PWnkt6nSsHcrnLq49", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:35:05"} {"_id": "4cjcymwSb2g9yRsii", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some c.Groups implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher->Student in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ajRjcW5eatfZWMfQS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:11:49"} {"_id": "GHmXfdnxvxna3dsK2", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher | (some c : Class | some c->Groups->t)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eycY5Q4KrKT82KoZA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:29:44"} {"_id": "R4w4LBtLBg446o5mE", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:39:28"} {"_id": "kc8xr3wfxH2n2Jobz", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-23 20:21:56"} {"_id": "Lv5LCdGCM9pPrPXfF", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in (Student & Teacher))\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ETs6cvB97EosWqpYS", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:30:49"} {"_id": "FBWeDi4bGzLJd2QTX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xMcJpNXZMATN36www", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:32:36"} {"_id": "DTHaEGNy9EFMfYKeP", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teacher->Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BP22TorSFHxRZYTsc", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:01:12"} {"_id": "6EjPHvPNXgBENxRAs", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(Teacher<:Teaches).(Teacher<:Teaches) in Iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYQfBWQt7spLhTX7H", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:44:08"} {"_id": "mqbGJCn7uhFHdhP4c", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some (Person.^Tutors & Teacher)\n}", "derivationOf": "kyHhAATkHid4j5ubm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:38:30"} {"_id": "j9Gx9zJ8y46ubC9yq", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~Class.Class in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xp2i6iQERojvEsTFA", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:26:07"} {"_id": "WXjypDaJSePsgdeQk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Person.(c.Groups) -> Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FbxFhQGWGhMA99u3i", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:45:52"} {"_id": "3YwMNXdDGQCXz5Mf2", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JEbcHjXgjDzmyxNGq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 17:56:28"} {"_id": "JpXxSgF4bSBEfMg5Y", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches & Teacher in Class \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s3aQehPxpj8sJhvEw", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:22:58"} {"_id": "HPhpZsA2qRjh4LZ2z", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HrDxhgvx6Lh7fcGY4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:20:50"} {"_id": "huNLu6kaqxLZKaJYn", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nz6R6AiPTX6zkbrBa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 15:18:34"} {"_id": "A2gSa3ZpSf3S8yXhW", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Tutors and no Tutors.Teachers\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZivbFSwNQfjZRbxiz", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 17:10:20"} {"_id": "amFT2vdGawCLnnpCD", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall c : Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DJjHZHAekdTaRYtH3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:01:48"} {"_id": "3q38PMXtGCryQaWoe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | some ((Person - c.Groups.Group) + (Teacher & Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FEdAHNkb25kvSbSJG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:49:39"} {"_id": "o8Fm8433ub6mHAAiJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and (Teacher.Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6o44YRDwfvenQNNte", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Tutors) (type = {this/Person})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:17:50"} {"_id": "jMntp8tcurwWcedPX", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher and no Teacher & no Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZgMaJx2wKtR6QQWxA", "msg": "There are 22 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ disj fun iden int none pred seq sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:09:02"} {"_id": "AuC7aojLgfJsM5GAW", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #(t.Teaches) > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CMekDNLNGmhub3WwF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:57:19"} {"_id": "erp3P5K7kntxw9byt", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher.Teaches & Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cwQKxwPb7mayMyGGL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:21:58"} {"_id": "Hr9vwoarznSfbhMwt", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Teacher and Tutors.Person in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CJYwg3PNd3cR8d4hv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:09:47"} {"_id": "vtwpqrPtpate4tnvd", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CGBg9ZaLJW3dR63CJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:20:14"} {"_id": "AhFD97eSCn6d3AFD3", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class | some g: Group | t->c in Teaches and c->t->g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qDhDMM3Fj6ghb5XNk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:57:02"} {"_id": "LonDNoHnBWiJC9aSx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some t: Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FbTpRv7wmi7BLdRyd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:39:11"} {"_id": "YNp8w2uLwxHJM9MqS", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 { all p : Person | Teacher in ^Tutors.p\n\n}", "derivationOf": "k7C4cpK9j2cr79MHZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 23:44:27"} {"_id": "4RSeLRMSuBzjwxbZC", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all s:Student , t:Teacher | Tutors.s in Teacher \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "bGETCBLTDnWJ3ebaF", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:09:07"} {"_id": "EdyoYtYmTnGbaw4KQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher<:Teaches).~(Teacher<:Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\tno Student & Class.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Person | some Teacher & ^Tutors.s\n}", "derivationOf": "CjmZFaAvq94MSB9jc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:33:36"} {"_id": "BZ9YgKE4eMzqHkacS", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n some Student & ((Class . Groups) . Group)\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4KkPtcipzhx9wAHdx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:14:18"} {"_id": "nZg6dWA8Qx2FQakD2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2dsoyqgL839B6Zfin", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:01:36"} {"_id": "f3v8A4ga82QfASirM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "SxT2zTq6xvCn6e5Cm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:10:47"} {"_id": "fWkvwajq9ZM3HLErY", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some Teacher & s.*Tutors\n}", "derivationOf": "FwzsxLSG5JAcLKegr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:49"} {"_id": "fsHe9EGk2iGuHJ99T", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GjujKXhgG5845LQKL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 21:07:19"} {"_id": "YnpfnmX5bPgFRAR5q", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p: Person | p is Student\n\n}\n\n/* There are no teachers. */\npred inv2 { \n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FsnSmPtW83Njc899R", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 10:02:15"} {"_id": "cnDDhcWXYjPqYdpWs", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \t\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all p : Person | p in Teacher implies lone p.Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BwZu3jPMMmntvjgsX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:28:48"} {"_id": "5q5CvQPSmq98ALu9g", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XiYiZYDSrZfCxvqzB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 16:42:14"} {"_id": "fMth8vRWKpGhML5La", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5H3dYGCDbQNaoDwhK", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:12:43"} {"_id": "t2NqPTjRBhAWsMPvp", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class | all a: Teaches.c and some a->s->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zAv3Bk64xkxtN68iX", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:13:02"} {"_id": "aLgzTqLkKyKymxHRt", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (Teacher & ^Tutors.p\n}", "derivationOf": "h5bWxW5QDtc8gPH4q", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:34:06"} {"_id": "saJWubk3dK3PTaLrX", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "coX3vgohMCmSKeh73", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 23:59:45"} {"_id": "HJpM4xB7M4uCDYJRG", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some t->Group in Groups\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4K6YsCQ9vR75B2C8j", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 15:48:19"} {"_id": "yxP4FoyY3kP4KDRvv", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QekPn3oYT6JqNgYWS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-10 13:18:41"} {"_id": "FNWLr935xc4TwtCd5", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FYgT3yzFn3ybxKFjt", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}]}, "nodePositions": {"Class0": {"x": 770.3999633789062, "y": 132.75555419921875}, "Class1": {"x": 256.79998779296875, "y": 265.5111083984375}, "Class2": {"x": 513.5999755859375, "y": 265.5111083984375}, "Group": {"x": 770.3999633789062, "y": 265.5111083984375}, "Person0": {"x": 513.5999755859375, "y": 132.75555419921875}, "Person1": {"x": 256.79998779296875, "y": 132.75555419921875}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-3 20:52:26"} {"_id": "9jHAt9raqnwYjv6AM", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8NMpXY8wBMAvKs3Ey", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:32:21"} {"_id": "sZTWxw24MWnaEymFa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s in Teaches.c.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5xC5nGeD2S6zDjCCo", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:27:49"} {"_id": "ynnrfpHDXZnYWss97", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wr3dqpe9QkC5aEn39", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:34:08"} {"_id": "p4FRwfbjQFJHsju4H", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c.Class,s:Student | c.Group.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FNWLr935xc4TwtCd5", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:22:17"} {"_id": "8w6PGtZMXpF6XWQHp", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | some (c.Groups & Student)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gu5iTQrErY7fcDznk", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 21:14:05"} {"_id": "sEkhDkDwFTMG79qNF", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XKiCwRT2d592vCDqZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 16:39:12"} {"_id": "yA9v4cTYRFLMSMyRR", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class | s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 23:00:46"} {"_id": "DpHjce2wM74bKER2u", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some g:Group | (s->g) in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dNJ6CjgFDbzmEANzc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:32:51"} {"_id": "RGpsvp8zcKraKvFxQ", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | one c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EPDxEtis6MAL8ePJE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:56:33"} {"_id": "GYkt8Zh6Fcc25hozF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some Person.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2etK7nsWyFJgWh59v", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:21:10"} {"_id": "Ta5zPgnxhZKeJdtrk", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dHyi3Nq3ATp62vM4K", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:27:12"} {"_id": "CDdcLDkEL94Hpkw2s", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D9iM3avAGDdHMTuW4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:39:24"} {"_id": "mWt5XzMEhDMS7GmeJ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NR9ZPk67Szjho9baW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:13:50"} {"_id": "vfSzWzPMy34TETRsA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GezB69JGgbH67vHQh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:19:58"} {"_id": "i4hPYkTmamZNHZ9iv", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall s:Student| some g:Group | no (Groups.(s->g) - Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "XNtNjk7iqWNFqZWRu", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:42:07"} {"_id": "PoetgL4K7LKJAei8K", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups) in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pTDPgz4pE7RobnyEJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:30:48"} {"_id": "r8i5LSZbYswJg4EMX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches:>c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2roL2gjXZzCoX8Guh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:05:42"} {"_id": "dtbL9hAchhnKnpeKp", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JdnfyzTfPEkJscCaR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:28:45"} {"_id": "7tAkoh2ZfBWTpZ9Rs", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bGxeFyQKgP8cK3Lou", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:13:59"} {"_id": "L2jPWaKZkGQFNx99S", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some Class.Groups->t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nEw82WNzXFYZeoqB4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:22:10"} {"_id": "t3KTQunidourcopAD", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ktPxqjxNYukSurKH4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:21:10"} {"_id": "kaEqe4zXfYCLQi8jn", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student |some Teacher i s.^Tutors\n}", "derivationOf": "sN2zTGP7zo2xvkCfK", "msg": "The name \"i\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:26"} {"_id": "9iBvXxXTMYA4oRAfw", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mddwZyiuS5o6K8dBc", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:16:41"} {"_id": "gKGYwNQDkmTM4PP8K", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "KRH3NknMWJnssTNY9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:49:59"} {"_id": "NmL3p5siwawxWWZ2T", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | (Teacher + Student) in c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x58wcB3D7aKRqRKxC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 21:59:20"} {"_id": "8ketwBEsw2q9ypirn", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DzxcX2sPLwwgjFYhD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:26:55"} {"_id": "ynqm3kEAhYgbi2mnP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RzcqN8mKuPPm3FQBW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-30 01:16:50"} {"_id": "EFD8FdRsp89vPQvKC", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some ~Teaches&Teacher.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kniabvfKCteXs7ceL", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-14 16:08:24"} {"_id": "bxdyhtTphPXuqt8du", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | ((some c.Groups) implies ((Teacher.Teaches)->c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W4AGYSBBHkHZAqNHG", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:20:49"} {"_id": "yT5n6LkmA3sYHsxXm", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8aTb8brFGDRX3oad8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 14:49:19"} {"_id": "hhervXiKRMsdJvw3K", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some Teacher.Teaches.c\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 18:32:37"} {"_id": "comXQwN7EvhNKzBqT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | some s:Student, g: Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DkeofihAaRCTfQML9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 17:21:42"} {"_id": "whe5EBeSmusqh8W3n", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "u9EDvxE5G4RjrsSGe", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:46"} {"_id": "yJDdaKzDYTp2kytHc", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3mwcWR8nTS4dY728x", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:50:16"} {"_id": "hjF9Akgq6JHZvdinT", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E6JR2oranuJwGBsZK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:02:06"} {"_id": "w2eMo3SY4wWqFPNnE", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t~Teaches.Teaches in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J6SCcCuaZePsHZgKQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:31:37"} {"_id": "39fEwcZnRToD4isge", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | s.c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9XEQCTrLJJo3FKL7W", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:50:31"} {"_id": "dg52CAogGAr3KvWa3", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Teacher.Tutors and Teacher in Student.~Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qitgQZPTcvMxj8yXP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:34:17"} {"_id": "T8anGbB2Pcre2PbBW", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}", "derivationOf": "iwLtoD7PhyRf778j7", "msg": "The name \"inv1\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-27 10:35:27"} {"_id": "KkqDEbzG2NYL8D2K9", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n (Person in Teacher) or (Person in Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Nk5Fd5Jt79gKJhuo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:54:20"} {"_id": "JyPuPXDEgPSyLRgna", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher<:Tutors:>+Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZbmMip9RTX3bttSb4", "msg": "There are 22 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ disj fun iden int none pred seq sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:04:54"} {"_id": "jQYxGn8uugHaQ2M39", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nvDX3gNZ25AYy3QRN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 19:36:23"} {"_id": "a6GiDPhTEuPAQTmPu", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Teacher+Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MNHFQHXJasnGa9wfE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:33:54"} {"_id": "h4SdzxavXquZEfTrT", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Person | lone Teaches->c and lone p->Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CGQbdaCbH53EsEXpR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 23:00:46"} {"_id": "EkxiKFTL52YSE644h", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5m7328wbAQBmvrA89", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:12:19"} {"_id": "wsqR7dbLMnm9WKhbL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, p1 : Teacher, p2 : Student | {\n ((p1->c in Teaches) and (c->p2->g in Groups)) implies (p1->p2 in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "9kuMEYJCQ5nia5inf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 18:24:14"} {"_id": "CzF4MCEMhSa9wqM6D", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4LdXpdvFKnLEyTBMB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:30:15"} {"_id": "wLrHXW2Dk6zr8o2Sv", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class:>Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher:>Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5dmb4gMdxadwEEtCF", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:18:30"} {"_id": "masYrkmjQvcbei8uK", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "y5zx6xuDu4ahC4m4R", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:27"} {"_id": "4efsZjyeSJ7ptnqWG", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => (some t : Teacher | t->c in Teaches)\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c : Class, p->g : c.Groups.Person, t : Teacher->c | t->p in Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xPuEJWhhpCzebTy6i", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:29:14"} {"_id": "S6fqQNAaFahuxhbxP", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person |some g:Group | all t:Teacher | t-> Groups.(p,g) in Teaches \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "e4s44RKQuzi3yRbnn", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:34:40"} {"_id": "ZgMaJx2wKtR6QQWxA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher and no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xn7dneombu2mQxX2f", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:08:36"} {"_id": "rNJH9rE2j8eDu3Tdd", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YprsA3Xd5k5rciyJY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:06:07"} {"_id": "bpkDERqrdLKsRzNxM", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n \tsome Teacher & ^Tutors.Person\n}", "derivationOf": "aARw6amA6HRu89s5z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:35:19"} {"_id": "rCmaX2fa5msmBWLjN", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u88Ksc7mveL62EM4S", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:08:45"} {"_id": "7wFXdTf2ZLe2qsfvC", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c & Teacher\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t:Teacher, s:Student | Teaches.t = s.Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MuhpcHQpQFBAgJa8n", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 14:57:26"} {"_id": "8Jaz5oqPNGwTCvSYQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7xcjzJm2J2nZE6u5Z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:29:39"} {"_id": "XNyQQLeD6Wq7EZr8e", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e6iSP6TpiAeoM3QkZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:54:03"} {"_id": "DXP2Pw3SYLZTHjWjo", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7rwqWaNXJnDMqEoDN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:15:37"} {"_id": "bARrTLp2JykDZ5G9m", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^Tutors in Teacher\n}", "derivationOf": "6RiAPWrWbqCLWsLFb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:56:04"} {"_id": "Ji7RS6TKRBJo8eMb3", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { lone c:Class | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class { lone t:Teacher | t in c.~Teaches}\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class { all s:Student | some g:Group | g in c.Groups.s}\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JkeSHZDN2uAurZCDN", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Group": {"x": 630.6666666666666, "y": 199.1999969482422}, "Person": {"x": 315.33333333333337, "y": 199.1999969482422}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-11-13 04:23:02"} {"_id": "xa842x8LSn7shnJmk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "48LnhHd2x2W8KKMyF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:46:39"} {"_id": "ZbMMtRHC6QTiD3CKS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teaches.c implies c -> Person -> Group in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "szRB3AKBvRpRgukB5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:32:52"} {"_id": "eK8yEq3YzNYhp8xWj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet Teachers = Teacher <: Teaches | ~Teachers.Teachers in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~Teaches.Teaches in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hrpttRM9cMo7Nnhxb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 15:34:19"} {"_id": "g7dpkix9NeqZvem8e", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher & ~Teaches.Person in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DzWivgbdHrBNWiC5j", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:30:28"} {"_id": "Qs5SnowPhtKqEjPFt", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xdvDTjFQouFnPmFKy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:04:56"} {"_id": "Nz3i4R5kDGf5tSHjY", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | all g : c.Groups | p in Student implies p->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EJ37dz7WXNnu6jxzE", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:16:12"} {"_id": "ma5TcReBEzdWYJ7Ch", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p:Person | p.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WQEMP3kSQ3iFMfQHs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:17:38"} {"_id": "fqaeMP9FxqFKzKs5N", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PRWTYLmxN67A6LvLA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:38:48"} {"_id": "NBcLukpbZZH35uxrt", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dqKR3JYr62ZwhT5AA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 20:47:19"} {"_id": "DqFMvEmg6q6SDNDan", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oXycrNwMokD5Jmcsz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:55:03"} {"_id": "f8nL4QjDTLkXpSiJQ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t~((Groups.Group):>Teacher) in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MP5obmhyy4ovLp3zQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:24:22"} {"_id": "BymHiSon7nCyQqQN9", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = ((Teaches.Person), Group.~((Person.Teaches).Groups))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7agyWb79u7PrcNBuh", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:53:10"} {"_id": "RZZjpg6mgXThDbwNS", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ke8WLPSFwZ5qPrBp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:07:58"} {"_id": "tXGTC2gQtwFB5zgzy", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches.~Teaches :> Teacher->Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e8BpfEfDpQTNWnpbv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 15:23:34"} {"_id": "Y2d3SuRDHuDr98BaX", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YRpb4kbgHyuPn4byL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:35:16"} {"_id": "pr893SvzSbCCXNo86", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t->Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ep3cqiLq7zcpLPzcz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:21:52"} {"_id": "xyZreyoa7FysaRQSM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q5t5tMn9m2c8TPPWh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:34:01"} {"_id": "Mj8iYxPePpL2n8AZi", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bsxRJg9eiibQsRLFi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:09:11"} {"_id": "M7MByJW2gMZL9jqd7", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "Ruax2cFku4rfh7CXK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-16 03:25:41"} {"_id": "CCrZPcCY8CvgGRGYi", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tsome c:Class | {(x,y)| (x,y) in c.Groups } implies no Person \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "7JirzTPfM5NsqfmbP", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:43:22"} {"_id": "rjyHKwXtGmDSzmWsA", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qpbDnGM5i9zLJpozh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:42:58"} {"_id": "cgxhG98xKJcGDadXa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NNhFEA2qg4uPjz34H", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:38:09"} {"_id": "oQ6PdG3qoRBAfouL7", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wo7sLZ3oefD8hvibk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:07:03"} {"_id": "Pnhp4po5S3FCtewaQ", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher, c, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n\npred inv14 {\n \n}\n\n\npred inv15 {\n\tall p : Person | some t : Teacher | p in Tutors or p->t in Tutors or p->t in Tutors.Tutors\n}", "derivationOf": "AtaKJd7e7ZRmcHtxg", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:23:20"} {"_id": "CEWwNTW7rtqpmttwN", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vLAMaQub3ZMhfZb9u", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 23:53:22"} {"_id": "DnAiSD6Rm3AmbbNDQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JihHaiHCefwukfYdS", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:27:37"} {"_id": "owRdDBypWk25y2S9B", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PYtuaMSesb2wPGTps", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:02:22"} {"_id": "DE4iTYxaHQtztqbpL", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | some c: Class | t.Teaches and c->t \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aAYDykTQXN52MFQsi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:12:52"} {"_id": "2G4vyrxaGE2eFX54P", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c:>Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oE36KN2DTGwT9Zb9m", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:04:57"} {"_id": "ezTKFMAmAcZo7ZCig", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | some Student->c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zFiq6JPRFQE42ydym", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:28:53"} {"_id": "cz6y6zPWYZsYBXHou", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j6pKaFc2yEa3z5fhg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:04:09"} {"_id": "v7NHvpNwPKFdSXWbR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p not in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5mGSEW6EWn22R6XTy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:02:26"} {"_id": "rMDuP7SHeXZZXmcBY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tStudent in Class . Groups . Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CGzEjiPk9ris4MB3m", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:46:32"} {"_id": "mFjdw4zANtmSWoy7Z", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class , g:Group iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b7Yroat5CXNwxYz28", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:27:53"} {"_id": "XDjbcd4GdwiDBR67R", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "557HDjKFR6PZnqpkW", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:33"} {"_id": "Jav2YK3Zbo3Zok5Sf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeaches.~Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wYCe5pdcFhCF6GbEt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:30"} {"_id": "sQsrEAPjSKy8J74pA", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tfor p : Person | (p.*Tutors) in Teacher \n}", "derivationOf": "qcixKANMaDuYqtcst", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:12:31"} {"_id": "jWSDNvq25HwiZ2YiN", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c : Class | lone Teacher <: c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BwicFSSSaf3twcSXD", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:51:23"} {"_id": "ouDTQrcChDJXtcbak", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Student)\n\n\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aaMBfWM8DjdYbgj6B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:45:07"} {"_id": "ns3i3Q43KFZnAPKgs", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:14:54"} {"_id": "mzP4zyEtm5zwBk7Qm", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DPPECbnPATb3g3dYP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:52:46"} {"_id": "eLQzqtQaBTA2f4crn", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class -> Group implies Teacher -> Class\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h9FDemtvbQREzZkb5", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:53:27"} {"_id": "X36cofu3QGt3ugkXn", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {some Person.(Class.Groups) implies one Class.~Teaches&Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x4Ma3Qiseu67a7NNh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 19:21:37"} {"_id": "orakyk5etC3KfWizv", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Class.Groups - c.Groups) + (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NcSAGrm4kFpX5Asec", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:49:59"} {"_id": "38kneNhHxpamLpZxE", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WyMMvTvqgXcnhJEfk", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:05:29"} {"_id": "79chGR8kP5prxuBNt", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k8pz4avYFWoapSYDw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:06:35"} {"_id": "CGHLuDkkAErxTzyZK", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EhYukWLz4XyufMmEB", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:42:51"} {"_id": "HQ8TTajtTj2kPC3mZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (c.Groups.Group) in Person.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "TJHguN99XPhf3WYTY", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:35:47"} {"_id": "fqmwj8FqhLGggSRjm", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 12:58:05"} {"_id": "BiwaAYz6taJMCsmnT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | some s: Student | one g : Group | s->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7cNGSaYtwNjcbnkjW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 18:25:46"} {"_id": "tE533avcjwvxJCD5v", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { no Teacher in Person\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:26:15"} {"_id": "ZT2iu68PYi26GMv5Q", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:05:09"} {"_id": "i2gsBRs5uFcZKrWTa", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-2-9 15:44:15"} {"_id": "ujTJZmZ8e4DLDE7jY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some(c.(~Teaches)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some g : Group | t->g in (Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "Aqv8ivmMY3XvENDsr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:49:43"} {"_id": "avrAjBF3nMh2TnHzo", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SMSjy4pxaiv2xHEJY", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:06:14"} {"_id": "4cDXdg2Lprqktf2Pd", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wsgB3ZNLNj7arv2BR", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:30:47"} {"_id": "43eYNERbR8A7Nu8Ni", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "B3yRiCN2eBBwW9aEQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:50:11"} {"_id": "XXrH4o9AS6aJtp57w", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person.Group | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7DZe6KXyQRQw4n5Q3", "msg": "This cannot be a legal relational join where\nleft hand side is c . (this/Class <: Groups) . this/Person (type = {none})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:30:29"} {"_id": "vFGMJ6grNWSeBGBK9", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cg2hPe5vjf4poriS7", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:50:38"} {"_id": "FWq2CLczcAFwnQEQN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | some Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EBvfzZpkXvtR5ypHy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:00:43"} {"_id": "oCZvsJXQLuaaqcPxM", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (*Tutors.p) in Teacher \n}", "derivationOf": "eeXn9hfsQwNAwdCcQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:17:02"} {"_id": "MoBdqG4htkafKJ48h", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches=c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HNPFnrNc6g5wf793h", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 21:31:43"} {"_id": "MG5iFjDDjt4hLwQgr", "cmd_i": 0, "code": "sig Name, Addr {}\nsig Book {\n addr: Name -> Addr\n }\n\npred show {}\nrun show for 3 but 1 Book", "derivationOf": "hsK7NvzoXeQKGzEfC", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:27:28"} {"_id": "JciokBgXnkPdk9czg", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n \n \n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "EwgvYWzR5Srh5EQq2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:32:30"} {"_id": "x5zFvT2kT5zLkJTTr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~((Groups.Group):>Teacher) in Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6a6dmSSGuBaKkARKb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:25:12"} {"_id": "S96dtaLnfmtQHdhv2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\tall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:39:26"} {"_id": "2pqgofMpQEtXB9LHo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher.Teaches:>c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cdWStGStiugDRg77Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:51:40"} {"_id": "sBSJMzvLDRxhvbHHu", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n\n\n\n", "derivationOf": "DyBMtwzKD9QdmtZFh", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 232.94270833333331, "y": 199}, "Class1": {"x": 465.8854166666667, "y": 199}, "Group0": {"x": 465.8854166666667, "y": 298.5}, "Group1": {"x": 232.94270833333331, "y": 298.5}, "Person0": {"x": 232.94270833333331, "y": 99.5}, "Person1": {"x": 465.8854166666667, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-19 10:24:45"} {"_id": "ipXGNq5JFPGAfH2mv", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sbWdzsouvykC7wRAX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:26:02"} {"_id": "Dnw3BJjN6bAvGhFA7", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher in c->Groups \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jLHcH5Qw8dpaQwbHy", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:33:17"} {"_id": "BMdQdMqXmm7NSDtHg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && p.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qTpbdoov9swhdHFRn", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:45:20"} {"_id": "soHt8wpXeerbnEPEp", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uKpGi7YC5t7xRzDGP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:47:43"} {"_id": "hyh522Gxjf3ShLoSL", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vfSzWzPMy34TETRsA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:20:00"} {"_id": "2uwXBSEgJoZ3i3R99", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall Person & Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:45:26"} {"_id": "PdLuJgXnoh6DZkhjQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one (c & Teacher.Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HjTNKQ7nT7qNSMAab", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:36:15"} {"_id": "PSZrf5A3Hv5x6mCpT", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c.Class | lone c.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2p9GaeA3Hb7XuuXYL", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:23:23"} {"_id": "2ZqwGqKc4P2rWqfGe", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teacher & Teaches.c => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RPKH8EJJg2HJXHJ2k", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:12:10"} {"_id": "qpGubtX9Qkru9MoXw", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JYFAGjtos9impqiwh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:53:31"} {"_id": "FoytGxfTK3d9digbZ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | t.Teaches in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nmuKyJpQg6gphMC5E", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 17:28:34"} {"_id": "qMMHLEmY2HmYvvYRX", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | (~Groups.c).(c.Groups) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DA64oA73eFqCJxaE4", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:52:30"} {"_id": "Xz8uM6qnay4Hu6F4G", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | lone c.Groups implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "NQ46brYMqSg3BRAth", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:19:36"} {"_id": "mppJ4PM5LALwe4Geu", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class, s : Student | some (c, s).Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PtNEo7FGZFtX8KjMT", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:00:48"} {"_id": "37xTMTuuKSXqnxLhD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | no Student.(c.Groups) & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aRxqLvhbT6NrannBM", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:18:55"} {"_id": "GTnYgWjf34geqTHAx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TX5nQK9y3xB9h6MPF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 16:56:39"} {"_id": "GKuEC27C83mWPBTgq", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher | some t.Teaches=c implies some c.Groups.Group \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YqQib3J7L5KLWFSix", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:53:32"} {"_id": "C5HEiWXd74ZPu4kxc", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WcGBDQWdHrd8FoCzw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-2-24 15:28:03"} {"_id": "TLmwt9oSfNn7ma9EC", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome Class.Groups->Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L2jPWaKZkGQFNx99S", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:22:57"} {"_id": "FERx3D2YdSjGv8NGQ", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher in s.^Teacher\n}", "derivationOf": "ce4ncnbnjnq7ziBTf", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:56:25"} {"_id": "stDwpstHa4JcdwGKD", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher & s . ^Tutors\n}", "derivationOf": "edtaw2q5H9Yvqe5Fn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:58:06"} {"_id": "5nu5HZZRXBTnbNDyY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SLrpnoGRMvzA8gPzN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:54:44"} {"_id": "Ta6KDw94A5QCtvn8u", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | all s: Student | s.Tutors = none and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cbPSz77zBTym2jqMg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 19:31:57"} {"_id": "NJpLp9ubNovDZ4gxL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (c.Groups) implies Teacher = Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "wbAefYAWfN9kgv5mQ", "msg": "== is redundant, because the left and right expressions always have the same value.\nLeft type = {this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 09:54:30"} {"_id": "qEHTFm3mCb57gm5yG", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zpCjfEgkdn6vfWDjP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:25:35"} {"_id": "TR6yjaxxPM6m8cww8", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher \n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fKbRqcNH2JR2fCRez", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:50:47"} {"_id": "mQ3AfmBXxyLzLk9re", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "cthWGAELdfDFRGpxa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:23"} {"_id": "2qnMwcWp7Sz83x8hT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BYGJ2syRqQqmByEkw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-19 19:27:23"} {"_id": "YjFFPCJm2x9B9EZvw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rE6qGgFYnR2EKKeti", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 21:45:43"} {"_id": "sW4Tnqo84bsdsZNyr", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\n\npred inv13 {\n Tutors.Person in Teacher \n Person.Tutors in Student\n\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "mjtvN3aMuBpdfo67h", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 00:38:11"} {"_id": "zssJ6tjr8kF8wTuDB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDDbnHbWokKcwcJP7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:05:06"} {"_id": "2rYe7GTYQg5TKcAR9", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "w9JjWyTLGGZZ9p8ko", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 10:04:08"} {"_id": "Pd7YFSLXvy3bjRsWz", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c: Class | Teaches.c->c.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p: Person | some Teacher & p.*Tutors\n}", "derivationOf": "5svvu6FqffcE4dxeW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:09:30"} {"_id": "t8YoWfF75FEi7SDWb", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zxaCXfm7vH7eextLG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:47:43"} {"_id": "n4x3Gi65N4HibmXS2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher<:Teaches).(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G6CwPiu8WiREYuwdm", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:05:29"} {"_id": "Rn3CvfLvvYY5Np3Qq", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c:Class,p:Person | p in (c.Groups).Group implies Teaches.c -> p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BPmgNGx7Dy3gBQjod", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:42:49"} {"_id": "B2rbrP86EFNyihaku", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tPerson -> lone Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9Q2isy5LrnPr8g6Bk", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:54:07"} {"_id": "YiR4XtEzxvSujCFBE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Groups | Student \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n3kRRFeLz4HAecBMw", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:30"} {"_id": "mQX5TCaQSxd59asqJ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TQZW4hGQDjMshKiJS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:34:42"} {"_id": "y5jYe9cMdJsrBwX4H", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher, g: Group | c->t->g in groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JTAQSrQ3pydKMXiii", "msg": "The name \"groups\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:50:34"} {"_id": "9u5o6QRb6HmTbvHWY", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(Tutors).Teacher)\n}", "derivationOf": "ZGAbeG4XnJicFu5Av", "msg": "This cannot be a legal relational join where\nleft hand side is p . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 17:57:49"} {"_id": "mTdaGgCSKHof9caDv", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j6GTpsDG62ef7Lmz7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:02:38"} {"_id": "uLuT45xYTkovNXf2d", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p : Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno p : Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6KsS9d5NkWmDoPcDS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:34:22"} {"_id": "MXSgHHeotXtgi6FdR", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p: Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n not some s: Student, t: Teacher | s = t\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p in Student or p in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t: Teacher, s: Student | not no t.Teaches and no s.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d37waegohfo47a35s", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:55:14"} {"_id": "LSvwtE7Ec7gEWZJRZ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BDb7tgAz2GarvFc2f", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 15:05:35"} {"_id": "yHuzPNx7k724LbTzF", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fqp7zegtDbBAynt4Z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:37:48"} {"_id": "5PDTbesaeYgESfCh4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KExecy2XWDrNRcduk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:03:29"} {"_id": "zmxXZhy5S6zZSdi2E", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all c : Class , t : Teacher | t.Teaches.c\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G5yB5CNw4YrDYiBsW", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:05:28"} {"_id": "wr3dqpe9QkC5aEn39", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches <=> (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kMEaWjeZeCJdBKJPf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:33:55"} {"_id": "duzDvnLdpJpiCuPK3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c.Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H4WG22JLHw7Z9T95u", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:08:32"} {"_id": "Q2KmYLGrwiCFkNtNZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class, t : Teacher | some t->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fhfw6rthTyeftddbA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:15:19"} {"_id": "ZsXZHzgo6Hn4jXdij", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYQfBWQt7spLhTX7H", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:44:34"} {"_id": "ZwX25FAAAkuXKyjfQ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:35:25"} {"_id": "ehHEuZyw5eH2DzcNi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, p : Person | some p.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xhsJ7mmm4yR62fmDT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:35:51"} {"_id": "D3n2EfPhBboewRm7z", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Student.(c.Groups) in (Teaches.c & Person.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ouQMe6JvckE7gZcJv", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:27:29"} {"_id": "8ZTGev9JnX8hnZpiK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all t : Person.Tutors | t in Student) and (all t1 : Person.Teaches | t1 in Teacher)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dJXsDfaeeQKbvbzmb", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:59:51"} {"_id": "xApAhTH8thfB79m3x", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "fTyg7YRYE83SybFHd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:20:06"} {"_id": "esnwEtuw5w9ZkEJwx", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gD99od6CWvPxryRa8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 10:09:29"} {"_id": "wGueRSww8qJESNHB8", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n ~((Groups.Group):>Teacher) in Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "reMt9fWrNTfYK4FdC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:26:19"} {"_id": "L474srti8vXPRnzNu", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GytN2igwMNha258wB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 19:39:09"} {"_id": "p457T3RXmwPsQY3KG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t49SHboHczLmwbFMS", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:11:06"} {"_id": "DjxLZLQkEtRdXswir", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (Person in (Student & Teacher))\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lv5LCdGCM9pPrPXfF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:31:05"} {"_id": "bhkb6vWkrC7ktxFp8", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8XRFvsFG47Rp4zNua", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 00:39:13"} {"_id": "73fpTBudsKXsh7qSt", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Classes | Teaches . c . Tutors = Class . Groups . Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JFCNstfLMxmh9DGFx", "msg": "The name \"Classes\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:28:57"} {"_id": "6TJJnG953CEreCSrX", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "jK68NwyzZwmfFuGMk", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:53"} {"_id": "dQ8n9McArQrSN6Cqj", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | (some s.(c.Groups) and some (t<:Teaches).c \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xk87cQNnwyKnmDxKS", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:02:20"} {"_id": "cvDAX8T9Gx8qLus7i", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | t->c in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mYsFSvSWGw5XK3SRr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 12:01:42"} {"_id": "TGuwxzmBWjRzj3gn3", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher, s : Student | s in p.Tutors and t in Tutors.p\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tSgbWY97Z2GpiKFzn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:40:39"} {"_id": "4intK7GvgxQhwpuit", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (c.Groups.Group) in Person.(c.Grupos)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "bduFwNko4uG2nbfDY", "msg": "The name \"Grupos\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:35:10"} {"_id": "2etK7nsWyFJgWh59v", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some Student.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JQvHWGyDor7PQYwhE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:20:54"} {"_id": "dYJMHfgwpdRvfhn5y", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QoHqJte5oqzvYzbPz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-2 17:37:51"} {"_id": "oF8vbFTA4ovZv9z45", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c.Groups in c.Tutors->c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5bELwdTwEL8PsLQdb", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:23:45"} {"_id": "tWZte4orYqNbHgAHi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | (Student.(c.Groups) & Group) in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "tLcnmzd2gX32Amxhm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:38:21"} {"_id": "9twrdegg3wThToLct", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher, s : Student | some t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R2x5S6YvTPn2uZwP2", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:03:29"} {"_id": "GHBX9SaQhPF4wsC2H", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n some Teacher & Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fzuJWDzFBTPRJcJSz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:27:53"} {"_id": "qcixKANMaDuYqtcst", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tfor p in Person | (p.*Tutors) in Teacher \n}", "derivationOf": "R5iutxmqhTzhxGkHQ", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:11:37"} {"_id": "6RiAPWrWbqCLWsLFb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.Tutors in Teacher\n}", "derivationOf": "Xj5kNtBw7nHieDcGN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:55:57"} {"_id": "pDXJGQ5Sd2e5Dq8va", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches.c -> Class.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "38yipSW9HYXJGSPSy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:00:28"} {"_id": "JnLtdFgBe52GBuATS", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s: Student | Teaches.Groups.(s->Group) in Teacher\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DoGxQf4tN6n46xtkW", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:03:25"} {"_id": "jcFgbxbTXb5Psab2r", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \t\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xqdmjgBgXbtnfaTq8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:23:35"} {"_id": "GotHAnqmpuCNBL9Yi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-12-16 11:33:08"} {"_id": "NNbY7rqyLDLMdKY5T", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | (p in Teacher) or (p.^(~Tutors) in Teacher)\n}", "derivationOf": "2CunhP38eBmF6xh8u", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-16 03:26:34"} {"_id": "dftvBKNBfAnQN56RA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall t : Teacher, s : Student | t.Tutors in Student and Tutors.s in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\nall t : Teacher | some Tutors.((t.Teaches).Groups.Group)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:24:38"} {"_id": "JvCotHLZhRL5i8cAs", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Teacher in (Teacher.Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tQSjjysGJzoZPWYtH", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:36:23"} {"_id": "id5zG8GnsKc9kcKM6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x:Class, p:Student| some g:Group | x->p->g in Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:24:12"} {"_id": "eSyvEbNWWLDy4RjBe", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "znYvQeYeY3t65G7ND", "original": "zRAn69AocpkmxXZnW", "sat": 1, "theme": {"currentFramePosition": {}, "currentState": 0, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}]}, "nodePositions": {"Class": {"x": 346.76319861207793, "y": 300.33214293845276}, "Group": {"x": 182.08334350585938, "y": 298.75000762939453}, "Person0": {"x": 546.2500305175781, "y": 298.75000762939453}, "Person1": {"x": 364.16668701171875, "y": 99.58333587646484}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-15 22:48:18"} {"_id": "wjrYXfBAYvn9qMyag", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "syzPBMCHMag4d825N", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 22:03:19"} {"_id": "DC3HKhSNFnDq8jAKp", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GcA2gFk62bX3oqMcb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:58:45"} {"_id": "6kCwZ7crumwapE4ub", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | one g: Group | c->s->g \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttfyqjt4PHENhKniu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:23:42"} {"_id": "JSeuRpe29mHWWxNTi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Class->Teacher \n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GNRXZCZqWwYnT3Qkx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:36:30"} {"_id": "5uWNtoB6aSjBpSdFs", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t.Teaches).c implies s.(t.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JrE26NMH8Ew3Qs48R", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:56:57"} {"_id": "fxCEQoNvQXDAyELys", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "ph4nrhQLsyeJjR8dD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:37:47"} {"_id": "Xt58Cx8LivyMYaoXi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:00:21"} {"_id": "aQhji4RW96nbvjGYT", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "znncpNLA7ANv2in9G", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:00:01"} {"_id": "WJdfMJuJPEtc2G29W", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall t:Teacher , s:Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6DnnRX4QeTYqcabtn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:42:52"} {"_id": "YAwC85e2h4ktSDYCg", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Srd6WTHpsHxEPetQE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:16:20"} {"_id": "Pi7rpG2waRSiMYW6A", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c:Class | (some g:Group |some p:Person | c->p->g in Groups) implies Teaches.c in Class\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ai42ZAkRwm4eEWZiA", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:48:42"} {"_id": "ca3vfHsLWh6cJRHvB", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | some p2.(c.Groups) and c in p1.Teaches implies p1 -> p2 in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dLLQWhk3ohQ4D6f85", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:57:09"} {"_id": "YYRGbrrrEAF72MpbM", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ziA3MrqhQwtJrhaXX", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-24 23:30:14"} {"_id": "RD8MjTQwcTcbRY7ZP", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teacher in c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n all t : Teacher | t in Class.Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zHobrcgsEaN2sGxHL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 22:04:23"} {"_id": "57LFoEzTshyDMkLtH", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "w9JjWyTLGGZZ9p8ko", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 10:04:08"} {"_id": "TbWNoD3sYwag4jRTw", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Class.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nzLDJmP3gnG2Geiz8", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:26:24"} {"_id": "aq3hkgjp9r5XaYgHa", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student => p in Teacher || p not in Teacher => p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JKrSkqgzXyysgPgnN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:22:28"} {"_id": "FdnwWNAXD82mjMeCX", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QNojExoMWZzTmPoKe", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:21:04"} {"_id": "hXyQTiF7i8kCw3vZ5", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.Groups.Group.Person in Teaches.Class\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cQWYj2udiczBWMPpa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:55:24"} {"_id": "wFBAeNQYtg2rPRaqq", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3e58SXdWcacmpoecY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 18:29:53"} {"_id": "PqxmhgXGGhfYWDKsG", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jg9q2uqnuRLqgSjHk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:07:41"} {"_id": "WjdGA6HHSD9qrWdMM", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Teacher in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZjsuK44s497Fs52rn", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:17:57"} {"_id": "bbAMXfaSmfTi2Dany", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3uHsfuaEftcRSpchj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:03:54"} {"_id": "NofhwxQfM3oPwWuzQ", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in Student+Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6aQRxabCKWf6i8Bv", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:26:52"} {"_id": "ZWWcoyMDCPXhBekZf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n \t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GEZ43aphgoBFBaKG8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 22:29:05"} {"_id": "qyuGSS39KJhBZhNSo", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome t : Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NY8rsq7SSz52e6nec", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 16:04:36"} {"_id": "wAYTDjgc6JngjvzB9", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:37:24"} {"_id": "cwtaMG8B7wTEMpfqX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome Teacher.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cy8kHjD2WLyc6B2Gp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:29:10"} {"_id": "Z33ZxS7y25Mc7icNZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class | all s : Student | some (c.Groups).s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3rJBfRYAFvF29AGsr", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:08:05"} {"_id": "tRKrPLmAS4LAJtzhM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2P5cwxHeF5DWnchhj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:00:56"} {"_id": "Yzfchy6uf6SZ9CDGj", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups .^ Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r5oWKyF6govycj6BJ", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:00:20"} {"_id": "wm9oSwphgZ9npc9ms", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E6wpXHPygWFzLqE3g", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 13:34:46"} {"_id": "HjTNKQ7nT7qNSMAab", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c in Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y7WoCziprdwRqBxm6", "msg": "This expression failed to be typechecked line 86, column 18, filename=/tmp/alloy_heredoc11975682208711747610.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:35:07"} {"_id": "N5LjkuDRscqnfnA29", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class, p:Person| some p.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E3pD35aotFcFBxygX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:37:03"} {"_id": "Eui73qPYg6GYLoXWG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher | some c.Groups.Person implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "krAGA53cWSMxcqsqm", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:39:54"} {"_id": "bLQKDyenxsaj23hB9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in Class.Groups implies (Teaches.c in Teaches.Class)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i7Bruk9buRWYEsyFE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:51:39"} {"_id": "TRjvu6MTcRqk4tWdW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in Class.Groups implies (Teaches.c in (Teaches.Class & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bLQKDyenxsaj23hB9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:52:00"} {"_id": "iS2ffGQ9SfD9D9wjn", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (Teacher.Teaches).Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "swPGMK8oLTf7eThwD", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:15"} {"_id": "6FGNZY8Bg3XWk9xo6", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n all c : Class | (c . Groups) . Group\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7yATogT8jEuEECygT", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:19:03"} {"_id": "6e6FGSQ7g9Z6Mmcy8", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { no Student or Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5q5CvQPSmq98ALu9g", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:43:26"} {"_id": "bCEFnaSjxrJ8HW3nH", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.(Person->Group) in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AXXCxvGiqHLSfJAfo", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 19:34:28"} {"_id": "w3ZEkkRbr3r8bhGPZ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k77Kdf7PP2PBJpA7s", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:02:11"} {"_id": "fQzFTewcqxwwLpfYJ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | c.Groups in (Student -> Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "WumAe3iFYgucAtqwJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:32:02"} {"_id": "NuP7rPGjCD4mZedTq", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class -> Student) <: (Class -> Teacher)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xn8urDPLctwx5Tzhr", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:09:15"} {"_id": "nohmsWGszo9ct5zP8", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : Student | c in s->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5ejYr8t7sij3rAuca", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:32:09"} {"_id": "giuXiujAanZD29BoK", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | all s: Student | student.tutors = empty and person.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHvqWDPsFhvfqfchp", "msg": "The name \"student\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:31:19"} {"_id": "Mc34h2STu6PjwMahj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HTcSQf9hToYcpna4v", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:56:46"} {"_id": "GEZ43aphgoBFBaKG8", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tno ~Teaches.Teaches - iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g7MHjQKxBPFb3o5pJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:28:58"} {"_id": "MsKuNjQPAD8mm8LRj", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \tall c:Class,g:Group | some t:Teacher,s:Student | some s in c.Groups.g implies t->c in Teaches and t->g in c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Nk4Zz9TjxXeJW9t2", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:47:04"} {"_id": "ewJQcp2fv7oD2QJS8", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3YXKcAgLnByLANkJe", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:51:26"} {"_id": "6pCk69tbRyeWG3MSp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ePykGYpKEcrKZkFW6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:11:46"} {"_id": "a6aQRxabCKWf6i8Bv", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "amKu3Y8pYwKxhacnZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:17:00"} {"_id": "rcahGnaLLoA59nYQD", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { Groups.Student\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CXSj7Rz8KEJAR5iyx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 21:42:09"} {"_id": "sCTrMTwRWQ5YGzGXd", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K4KuzrF7z8iQHakGH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:58:20"} {"_id": "FEdAHNkb25kvSbSJG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | some (Person - c.Groups.Group) + (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uHKCTvBAtHDXx2GMr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:49:20"} {"_id": "EHBxrNN6deroQHsaW", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n \n \n \n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "kMAxY7wNwaRxkQjmd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:35:24"} {"_id": "EjfnogYkmx7MeSn6X", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall p:Person | some g:Group | no (Class -(Groups.(p->g)) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PGEJDnf3TXA6k9op2", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:28:07"} {"_id": "ycpQwk8mpx6hSzgZt", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wjnQJquxczhzZhzTs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:27:59"} {"_id": "Hu5EgWYaQmiaKS6gk", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tTeacher in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qRKhNoCTS7cAkwDWX", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 20:28:13"} {"_id": "34kHaeGqseiuW4tbk", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H7gw2LyfnP9nSFzrG", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:02:51"} {"_id": "xW7sQxmjjQTH8aNeJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tsome c:Class |all t:Teacher | t->c in Teaches implies {(s,g): c.Groups | t->s in Tutors} \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "cmMXZBvxvXCDgHvyW", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:46:10"} {"_id": "Tkj85Q9Sr82mNkzLL", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GvJDKAi9aap9MpMJh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:20:44"} {"_id": "rjBwxeM93Brid9Dm8", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1:t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eetrejn3j85dGLQxE", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:33:16"} {"_id": "fZ2ziLcGiQxEq7Q6D", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c.Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LCmgJ2MTcs5xkNuuT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:30:16"} {"_id": "zkZKkBxcp6opFomFQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class -> Student) & (Class -> Teacher)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iRKdv5dmHdzFNwxDr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 23:08:11"} {"_id": "wqR4MmaLtSDS3Z6SL", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fffsBsr7Xn7XNYMqN", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:27:14"} {"_id": "xqdmjgBgXbtnfaTq8", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n all t:Teacher | lone t.Teaches\t\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DLYgDPpLpBDYpp6xN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:22:05"} {"_id": "KqAjHrFDjRvjdzPvF", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | t.Teaches implies (some Person <: Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dzBB9hLCvcfrzftHB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:34:18"} {"_id": "K3DxQ4vYvp5gXmHag", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J84ZYCoxBpZK89Fvq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:04:46"} {"_id": "BcoTLBjxJDQYuGLeq", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | one Class.s.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kZQzco8Qx3SL9x5aP", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 17:01:21"} {"_id": "WuSLR8rF3WBbeBN73", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y9JMgEzufeo3iYGQr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:37:57"} {"_id": "xMDA3tTBaRPKEebqc", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xxjCebyHH5yiXEf9N", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:03:25"} {"_id": "jMYMLLCxoWzkArpoq", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n \tsome (Teacher & ^Tutors.Person)\n}", "derivationOf": "bpkDERqrdLKsRzNxM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:35:28"} {"_id": "H8xgqH4J3vHAH5BQB", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "TJk7Ad8x3biY59JJJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:24"} {"_id": "krAGA53cWSMxcqsqm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher | some c.Groups.Group implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vD5YncgFkrcGvoAcy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:39:00"} {"_id": "eRRSTHeihRy99r8G2", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "syq8kZ5JdM8oygps8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:06:11"} {"_id": "wYpgJRJNmvejwxBZr", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some s.^Tutors & Teacher\n}", "derivationOf": "G9j3WZLPe9wHuNmjr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 09:52:31"} {"_id": "xPN2gusS2nbbgNwGq", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XuhhAsdfqMhTux7SZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:20:16"} {"_id": "WAAStarYLwHemW6Ad", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~ (Teacher<:Teaches).(Teacher<:Teaches) in Iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYQfBWQt7spLhTX7H", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:43:58"} {"_id": "BbhMYSzzipkdrAkDW", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "kX9A5hLh9e5He88aw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:20:12"} {"_id": "4Y48HS2r92KbTEH3s", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teaches & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ApHQCkFd9hdJXQ9QZ", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:46:07"} {"_id": "6snYhSRot4cDhw8bf", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tPerson no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fjz5PSnzpXQdeQ6MQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:07:16"} {"_id": "pGTxvSDguGpvT7Mxw", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson & (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TfgHXTQtHJqemwKSF", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:55:50"} {"_id": "nY8wboappkpR4WxFo", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HkkGzdbrm5Nho9TKh", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:43:08"} {"_id": "QRthw2uB2sHX8qLk3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, g:Group | Student in c.Groups.g\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9nxtqmv8sRe5yEdJy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:20:00"} {"_id": "c56zu2HFwKCBGgh8N", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some p.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7PBZqzn7gyP2qaZ3g", "msg": "The name \"p\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 18:27:31"} {"_id": "MYBG2aKFNyPwrDMwb", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tTeacher in Person.^Tutors\n}", "derivationOf": "wzxMmvGbgsLrwSFLn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:57:19"} {"_id": "bjifNHDhTkmfpi4qj", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent or Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RDTsQ22PTccxvMJmB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 15:18:46"} {"_id": "nvvrXBqoe93dLHAy5", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E7hXbRFvEmZGreZ7k", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:02:29"} {"_id": "Cm6SKaEgk95BsWwGo", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Groups.(Student->Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vePQvkBDT2GyubzzG", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:41:18"} {"_id": "GXrXhvqbpf4EPxC8T", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Group | Student \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xFPZdXQB328C3zuhS", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:31"} {"_id": "3yBvaESwhaaTnnfNk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ipPLwHNfkseb2ZuYd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:30:18"} {"_id": "6a44zu55wEv9Axqip", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Students | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "w7PPSyLukxTuGTifz", "msg": "The name \"Students\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 13:39:11"} {"_id": "n49Cd3yaw7NP96siQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in (Teaches.c & Tutors.Person)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GjdaypKExfP7GvZmz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:28:07"} {"_id": "pgetXzessfhCeyt7x", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ycNf8fHHpamJTFcKQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:15:59"} {"_id": "QQYduDSQXe6fz2jCK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-13 03:22:52"} {"_id": "E5E8HzkdDFeJoDofM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in ((Teacher & (Teaches . c)) . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "2QGduiPWdWNFvZFY7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:00"} {"_id": "xtzxGHQdJfwY2Rajm", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | not (lone Person -> c & Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BAb3Xo2x9G57JSoob", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:54:47"} {"_id": "Qpj6dSZzffmcRZZQi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | s in Teaches.Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ebrE4rRTqzaxTSCq9", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:48:57"} {"_id": "pyzTYz75Dn83fznDH", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \tTeaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pge4jMABi96wwocDh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:46"} {"_id": "aKYHCNY72xtEYgx7v", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t Teacher.^Tutors in Teacher\n}", "derivationOf": "wXTg86dQbdfQchmwN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 14:43:41"} {"_id": "PC8pbfpbyMgcH6xnG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches.c -> (Class.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A3FPhx5is8sMC7rnC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:31:48"} {"_id": "aYntxTKR8NSC3nzL3", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HzactSbCJwJ9jbkby", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:08:29"} {"_id": "sQNv2Tp9jGhkKDFLf", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall: c:Class, g:Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZCaPHGS2y4pqJaBzz", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:33:44"} {"_id": "P2Xg4NTj3Aa9oAgHd", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { Person in (Teacher or Student) \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { all p : Person | p in Teacher or p in Student and p not in Student and Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CxMPDEeXpbZWuRZ7N", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:49:30"} {"_id": "uwS7DACAbAHRLno2M", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9fbAsLRdNb3kMD8Q7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:37:57"} {"_id": "Hn6DeuzsYsQmhSsaK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher<:Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nMXDACSwZXheEuqTs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:10:11"} {"_id": "gD99od6CWvPxryRa8", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fvRfJsHgpoKT3JF9G", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 10:07:52"} {"_id": "H29MT8aJkG4NBRMeN", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches .Teacher) . (Teacher.Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GmdhCe4J5CjayEMNh", "msg": "This cannot be a legal relational join where\nleft hand side is ~ (this/Person <: Teaches) . this/Teacher (type = {this/Class})\nright hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:54"} {"_id": "Pge4jMABi96wwocDh", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \tsome Teacher.Group\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JLCP7SD4gLAhGwSNq", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:10"} {"_id": "EZvQsKdyNKCkuGJLm", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "srceQ69Mq8F2P7CLq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 12:18:07"} {"_id": "yp8AvxYqN4a2NZAM6", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | Teacher in c.Groups\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QgBSNf5GATxgTR8xp", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:33:50"} {"_id": "FhZ9e4mZk2cuXiWCR", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (((c.Groups).Person).Group) implies some (Teacher.Teaches).c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "nnyLmWECCgGfao2MD", "msg": "This cannot be a legal relational join where\nleft hand side is c . (this/Class <: Groups) . this/Person (type = {none})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:53:05"} {"_id": "DvY9fSWCKPndd2r59", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "bL8deG98uC7eYPxjx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:06:19"} {"_id": "r9DM62eCcnbm74fyS", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class {all t:Teacher |c in t.Teaches}\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zAm2ivGajJbh9Lf6B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:40:29"} {"_id": "QughbgnCbFFTZvLvC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student - Teacher) + (Teacher - Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zi4GkEWZmpiTRnFE6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:54:12"} {"_id": "Jg9q2uqnuRLqgSjHk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CgYEF7D6dbHNCWCY2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:05:45"} {"_id": "9cRpp8smkme6ksYZ4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aYntxTKR8NSC3nzL3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:10:05"} {"_id": "EzaH43RrpTxSikuzz", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t : Teacher | some ^Teaches.t\n}", "derivationOf": "jfYGGnPLjHF2b4EzD", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:12:28"} {"_id": "uemt8abkTuEKMcwqZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t<:Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ycLzwaL5s7qhAGYaY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:47:25"} {"_id": "yyLyHuddsgLv3AGYb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c in Teacher.Teaches \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3xrqEyR8WSyZs8Rev", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 19:08:34"} {"_id": "JiqmepQcdntZEKNwF", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Teacher+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "deidxaA4rEPCBJhfY", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:27:49"} {"_id": "jfzXsS4DHvsRHtStr", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EkYuBJmofsNa538fd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:08:44"} {"_id": "iRSJiXye5HpAmhnfG", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Person in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 17:52:24"} {"_id": "ku69EWMRe7wfG2nr6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CKk9t2CzG5GwsyKHH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:45:12"} {"_id": "wPsC9cQ7vFc8hgQ5F", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) & t.(Teaches.c) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QRKCo99CezLRyYayW", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Teaches) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:56:04"} {"_id": "8S2NkRbjNX4aWowpc", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome Teacher & ^Tutors.Person\n}", "derivationOf": "wtQQciM255Zzwn3vh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:17:32"} {"_id": "ZrrnAERqmyPYg3q27", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yQTrHHY8Sash6jgRS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:00:04"} {"_id": "NazNdNj4w8nJ5m2n2", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uMHwAsrNQaeWntTdX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:37:15"} {"_id": "kfMRvrDsqJBjpGrhf", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tsome c:Class | {(x,y)| (x,y) in c.Groups } \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "CCrZPcCY8CvgGRGYi", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:44:01"} {"_id": "GA3ssLAbuFkG5WL6v", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.Tutors & Student and Tutors.Person & Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q5PPAi7eTzHdPkwxc", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:31:30"} {"_id": "fGSG7jzicuDNy8mjH", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9jHAt9raqnwYjv6AM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:32:39"} {"_id": "RMDpFDkWq8DTP5oRf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | c . Groups . Group in Teaches . c . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RLiTrLNKwLrdvcZNT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:30:24"} {"_id": "bH3mSraj8tHvkYCxo", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pac7AgNLjCqumczE5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:56:47"} {"_id": "vN6mvdiBZ5u7Xq9hF", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HsmWsFrSNK477dy3J", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:03:19"} {"_id": "uosuDav96jsw87Qx7", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nY8wboappkpR4WxFo", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:43:26"} {"_id": "LuCXTBnBz6fYHiDR9", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "64TsGt2Nw35YFr4Jx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:53:35"} {"_id": "HQNae8zto8PnMw8ia", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LG6i2uoktYWtgJegk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:24:25"} {"_id": "c3TiJZJBWhatjZLet", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Student+Teacher in Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hHxcW7FRePQEcyQtY", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:37:49"} {"_id": "vFwu3m23u3o2ZHv4d", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rTDgHgZBRTwWDxbiu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:38:47"} {"_id": "kMEaWjeZeCJdBKJPf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TfALy3op2JGXcX768", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:33:42"} {"_id": "t4cT7okCjWezFtARz", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | one s->Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kBcBiD5Yo79SgDkhX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-8 17:10:56"} {"_id": "NSteqwtzt7hJiS6xq", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kcQE4jjsvMgJD5NA6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 14:46:46"} {"_id": "nHDkXnT5Ex2nf4NnL", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t~(Teacher.Teaches).Teaches in iden\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "95LKNg3QGeR9W3zwB", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 20:01:44"} {"_id": "u57HoqR5axsrJ4xLr", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class, s:Student |some g:Group (c.Groups (s->g) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "BX2yjbhDHJDW6tMRT", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:55:43"} {"_id": "6zebMqk9gsNmqGRQm", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c->Student | one s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dz4fskLTYzESt2mF6", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:52:49"} {"_id": "6SN4aMuhXsaqpZuwk", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher in Person\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KgwLK6muh4Zmz992z", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:36:13"} {"_id": "87L6rpoPWCFXGA8DQ", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors = {(p1, p2 in Person | p1 in Teacher and p2 in Student }\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CFAh9nrvMimRWvihg", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 17:18:50"} {"_id": "StGQ4h659wuYXnFxg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6SN4aMuhXsaqpZuwk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 16:41:44"} {"_id": "BhxWRcMF8RJhSHvnt", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t:Teacher | one t.Teaches:>c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uJjD85LnYooLsqJBG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:44:57"} {"_id": "Dzh56MnSHztgJhGBu", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome c : Class | lone Teaches.c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HeTpeYfyvZ3GqEtfw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:13:51"} {"_id": "t5CQfKaZirr5jYZey", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {all t,s: Person | t.Tutors.s implies (t in Teacher & s in Student) \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "scvp4vKPPWzXJsEgt", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:17:10"} {"_id": "khNDcmGDYughsmEf7", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n all s : Student | s <: (Class . Groups)\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ehwAL5YP2xL4NMbFd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:12:44"} {"_id": "ozvNWCJsLJccNiu8i", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some(^Tutors.s & Teacher)\n}", "derivationOf": "W4Ha6iae2Q5EhvBbW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 11:00:11"} {"_id": "EntSb8hRXNXj4zJy4", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Person.(^Tutors).Teacher\n}", "derivationOf": "JMMrmYydvza4akFcN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:24:20"} {"_id": "Mipegs7uPaD9WyjFt", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some Teaches.t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2QEjcAj7ia2eG6YAy", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:59:46"} {"_id": "XHjx9mjqP5RfrpS4f", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, t : Teacher | lone ((t.Teaches)->c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "pZExtCdABDjNuXJ8C", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:57:19"} {"_id": "XczKTFQmFQtoxAr8y", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RqESXvTFcu9i98GPt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:34:01"} {"_id": "zXFDAkK5CjcPWi7sa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rEkArkfS2PiHnKtTQ", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 20:59:03"} {"_id": "p2qF2jhL2ffnks3ss", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all c: Class, s:Person| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "rtLvHA87hrMPMYBfH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-18 11:52:19"} {"_id": "pej3aWi4d3qZTYWsK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no t.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dcBeNAciKypLQyYjs", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:58:15"} {"_id": "HaCHmrdSjjio4toBC", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WaLjhz3Z4RA4kSLFg", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-7 19:38:02"} {"_id": "k8qqe88ZQyPDZXjSF", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Teacher.Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HNnFBKkAdSMY2Z2p3", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:01:05"} {"_id": "H2KB4woDywQLjjaNm", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all Student:s | some (s.^Tutors & Teacher)\n}", "derivationOf": "dLTer7HBufcqrE3G2", "msg": "The name \"s\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 08:39:54"} {"_id": "cibNhhqbR4N5C9reu", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gwsobXPCiFDrTD8Mf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:20:46"} {"_id": "RDRgMQZ2SxKSFiTH8", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Person | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q2SGqEK7G3DfGRb3J", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:40:07"} {"_id": "QMLnQN8Ed9BpqTKMj", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ()\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "HdEozzXQNZsYjBE9X", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:20:38"} {"_id": "iZDj8Lwh8M7N9pkKb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.^Tutors) in Teacher \n}", "derivationOf": "Tspnihr4MJ55XEZd5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:13:24"} {"_id": "fvAAmeWR3qPHqTxxH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some (Teacher & s . ^Tutors)\n}", "derivationOf": "N8WnvN2n3tRMed3Ei", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:39"} {"_id": "FErfKybKB2eBAzh8y", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n ^Tutors :> Teacher\n}", "derivationOf": "CYfzMtBh7MApFdxD3", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:54:41"} {"_id": "5EP3GDyrBaBHpPWJp", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n\tClass.Groups iff Class in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zPdCMzHAZgaSqLppr", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:34:11"} {"_id": "Lv2FRTcusP3ZruAGg", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vwr79BWRdZ3tHWdqi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:23:13"} {"_id": "Aqv8ivmMY3XvENDsr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some g : Group | t->g in (Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "5MBX4pFGeHjfD5Bkg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:46:34"} {"_id": "CGzEjiPk9ris4MB3m", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tStudent in Class . Groups . Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uZ8wXKydDykfygXmW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:46:27"} {"_id": "fCdG5HFKMkWjfmWt3", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | (Class & (Groups.(s->g))) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "69PBZ2RopmhofQrdH", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:36:41"} {"_id": "eXujxvkD2EmzydZp5", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass & Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t-(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pZd2dmnCAPG2hZRXM", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:47:03"} {"_id": "yMbRmZMMxdmoa7H4n", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall c:Class | Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hjQNk4WctzrzD2tCy", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:17:58"} {"_id": "y5zx6xuDu4ahC4m4R", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "yqFG8ZGZ23FbGGtW2", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:22"} {"_id": "Fb9c9i9Amk76Ebksb", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some c.(s.Groups) and some Teaher & Teaches.c implies some Tutors.s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o5Zp6hBSTA2uj5ffa", "msg": "The name \"Teaher\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:26:38"} {"_id": "aawA4qGvMmGr75y8W", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some t:Teacher | t in (p.^Tutors)\n}", "derivationOf": "jPA7MqvBA4WgDPEFi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:52:23"} {"_id": "fYC4Eh2xruLzF5r5B", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "tGLawy3M4BaNgiHod", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:11"} {"_id": "TNCQ5yFDkhKfrYEfv", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Person.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HRccqt7usZq4m5pQC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:27:27"} {"_id": "YmnZqPZhLWj6xfoyY", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Tutors\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cBaevy4zbaoTpG8Qv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:45:55"} {"_id": "8o3T86sgDbKfDw7cx", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { Class.Student.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7JzLGx9q9Bas9rBuF", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 18:42:45"} {"_id": "2gu8QJnCBChsRXjgL", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ri83ejebhGYF8MCjq", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:27:29"} {"_id": "LRhtJ8vo3e9ssg2Hk", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E7yfYKAZD42XZoXLE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:27"} {"_id": "NSK48nmLT9fzHviDp", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FBcJTQzy22YucAMKL", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:01:08"} {"_id": "vELywhkteuTcyA9kC", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some p.(^Tutors) -> Teacher\n}", "derivationOf": "QzKyStXqxphF9knAz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:27:26"} {"_id": "MbpufcCbCJaSxZoix", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Db7tQR8KeNknLfF3x", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:31:04"} {"_id": "Pk72yKNBHNriD7XjS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) and some (t<:Teaches).Class implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9waTMebM2XTrbXZKo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:09:59"} {"_id": "2tjLkthn66hmwp42y", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n (Person in Teacher) or (Person in Student )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Eqhn4EQKpgq9Bp6qZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:49:09"} {"_id": "yLXKRH3LcmqLR3nG6", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Class.Teacher | some g: Group | t->g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TfuXjnHTAdKX3EiKb", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:53:56"} {"_id": "EyuYXPkHReJDtfrJt", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher|c.Groups implies t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bkXxHgpfFFdEpG7mk", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:46:00"} {"_id": "KMSos9Xz59WDKxt6J", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "tfeCh9ubgSaBxhPgu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 10:02:02"} {"_id": "Wt3zbXPfvRQJmnMrv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "FwNWmzoZ3gwvQ9Hxe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 09:45:29"} {"_id": "ZHyxnbQqv3WXw7MoA", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { Student -> Groups \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y7GRGk7G7o2CmpBjm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:39:49"} {"_id": "xoab47QXbqqDik2uv", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R5zm4dfzN8WAkx2q6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:03:01"} {"_id": "FfAbM7Nbeaft4Wfnj", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X9coXDosGmL3QD7ra", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:02:47"} {"_id": "HAa3EimESD3FGJCDJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 23:52:42"} {"_id": "w2wp28JCfvnNfXi98", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cvDAX8T9Gx8qLus7i", "msg": "This expression failed to be typechecked line 96, column 31, filename=/tmp/alloy_heredoc7686593538177405206.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:02:00"} {"_id": "dcjHBucyswktieb6q", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutor\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "79chGR8kP5prxuBNt", "msg": "The name \"Tutor\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 17:07:26"} {"_id": "PJ7nRqWZtJc5LgwRj", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall t : Teacher | some Class.(t.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aaub2GgpgkAAdaY3T", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:59:36"} {"_id": "JoF2XsPssTJ4HJpkS", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { Student.Tutors & Teacher.~Tutors\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t5CQfKaZirr5jYZey", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:51:11"} {"_id": "hAgCHGPa3newLtWZr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "mqtCfWdwiXdKccphr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:00:14"} {"_id": "8uHnDptk23xCHP6Sw", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q8wDShMZb6Cytqq7T", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:55:59"} {"_id": "hyzvBkcwpMuvosq8Z", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c->Groups.Person | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k3WDEK2iRyeJi6eEb", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:30:11"} {"_id": "45Dgvq2S9EWKd8qqz", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some c.(s.Groups) and some Teaches.c implies s.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pHNep24F8558ZGK3f", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:23:29"} {"_id": "tKAcQHTnqNrzArvSj", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | (t.Tutors & s.Tutors) implies (t in Teacher & s in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "xsdtbeuw7i4mMYwYa", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:04:13"} {"_id": "Wt6A258ZkbNBMbZGS", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some Teaches.c in Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "49k5KRzHdvmEqmWq4", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 18:38:07"} {"_id": "LJkxprLwzdcFMAkcZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KwKxFbptX5MbSW3WT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:58:28"} {"_id": "ihETkJZeSnx7kbzFc", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher, c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jb8Xo5dkWjuK8F4TF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:58:29"} {"_id": "gQFmtJ2cdbxWD7QfP", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XZLvjj5BK3CcGDwmi", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 207.6666717529297, "y": 199}, "Class1": {"x": 415.3333435058594, "y": 199}, "Class2": {"x": 623.0000152587891, "y": 199}, "Group0": {"x": 207.6666717529297, "y": 298.5}, "Group1": {"x": 415.3333435058594, "y": 298.5}, "Group2": {"x": 623.0000152587891, "y": 298.5}, "Person": {"x": 415.3333435058594, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 21:53:03"} {"_id": "t9AETZZXFQehu7Ck6", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno(Student & Person.Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e5uauvEPRRDZXGopx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 18:39:47"} {"_id": "xftQFfLjnK6N9tgCE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher in s . ^Teacher\n}", "derivationOf": "9zfDyxtMTeTbvxuy3", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:56:36"} {"_id": "EnKnJYjYCJQFqFMyJ", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Teacher \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DTe4sDqu5Nkjfif6G", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:33:23"} {"_id": "4YMzkewq5DMAHMifM", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | c <: t.Teaches implies (some Person <: c.Groups)\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m4oiBwoHGprd9XBkp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 18:13:44"} {"_id": "dsiT7fmoXPi7wC7Wx", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in teaches and t2->c in teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gh9c82Lttv7MBd8jt", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-10 15:35:13"} {"_id": "ueFiZf9W8DRQJ6JNj", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some Teacher<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jNhX7QDsvDx4TZeD6", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:50:25"} {"_id": "eeXn9hfsQwNAwdCcQ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.*Tutors) in Teacher \n}", "derivationOf": "YWTkCJk2MWsqhpbxC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:16:26"} {"_id": "jBbwc5a9p5qSkFfFq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all t:Teacher.(<:s.Group) in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "qfSoLeKvkvDdaappy", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:00:33"} {"_id": "wrBsTTuRwWrsBYqxg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | not lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mMztxrGuMiNbBd93D", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:54:30"} {"_id": "Dz4fskLTYzESt2mF6", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c->Student | s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h7bm9e4FsNaxMXDKq", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:52:43"} {"_id": "2mz5E9FvbtyP3fxsb", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YzHN6iSwsv8GjfHku", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:33"} {"_id": "Xt6pdqb7DzowAEEnE", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | (t.Teaches).((Groups.Person).Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "W8myzssT96auEHN8u", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is (this/Class <: Groups) . this/Person . this/Group (type = {none})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:08:23"} {"_id": "v5pTzojCS5StFE36o", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n (Teacher . (Teacher <: Teaches)) = Person\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5G9L372mgJa2K8GX5", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:37:05"} {"_id": "8nXcfDJ4uQyJYqir7", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "npgBE3PAFdMJfqsnF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:46:16"} {"_id": "QuKKAGrvM2pqTpW3e", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all f: Person implies f in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:27:32"} {"_id": "szRB3AKBvRpRgukB5", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (Teaches.c) implies some c -> Person -> Group in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vDPwsXAGxsqjsXMdu", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 17:31:47"} {"_id": "Dd2yEWnaLgnkrYEzF", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c.Groups.Person | #s.Group > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttwFLbgBr4o2Hp3ux", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {none})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:07:53"} {"_id": "CLCxDLz8K2Zx2LSK8", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LQDKhozHQYMivuN8P", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:05:49"} {"_id": "nK3Werk6kA4cWp76a", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | lone t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "dGBhWFDmNpX6Xf9SY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:33:54"} {"_id": "bsxRJg9eiibQsRLFi", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t.Teaches).c implies some (t.Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9CXbM8gka29vHXcHt", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:09:05"} {"_id": "E3Y2qRuKcwuWpKgbj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall p : Person | p in Teacher implies some p.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall p : Person | p in Teacher implies lone p.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7TcG76E7DCRQuj7wc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:32:17"} {"_id": "Z292nYPn2rzEyuPqs", "cmd_c": false, "cmd_i": 0, "cmd_n": "run$1", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun { some Teaches.Class }", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:18:44"} {"_id": "ayPoy4kPiY8AMh8DH", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JGHGvRc3DsSiMSwha", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:48:55"} {"_id": "Skjea8nJiXdWivh8B", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GBXmthqKwvWGHCZjw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:50:51"} {"_id": "c2Hm7AArTpK9ytdR5", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \t(Person & Student) &(Person & Teacher) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9j6JTbcAz56Z72B99", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:35:33"} {"_id": "hrpttRM9cMo7Nnhxb", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet Teachers = Teacher <: Teaches | ~Teachers.Teachers in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z38qu43242Zvyb7Yc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:32:19"} {"_id": "LSDopiAXnmSKaQg8M", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:08"} {"_id": "Rw2o6ADGCTmvCJSgS", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "92tC9h9Hhs6GcYS6j", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:28:10"} {"_id": "ZBzPKneA4kyrF7dDC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Teaches && no Teacher.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vCszoogXTpLfAjYjD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:57:47"} {"_id": "LvGz3SdKFsymZq2pv", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Tutors\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cBaevy4zbaoTpG8Qv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:45:55"} {"_id": "cbPSz77zBTym2jqMg", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | all s: Student | s.Tutors = empty and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6y42EHzCSgcvnJzfH", "msg": "The name \"empty\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:31:49"} {"_id": "NxjZeYDT39osY5Cym", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = \n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JA8Hy3Djs7cmDodyf", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:09:55"} {"_id": "nsrJ87wp8LDqyuxDo", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | all g : c.Groups | p in Student implies p->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nz3i4R5kDGf5tSHjY", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:19:11"} {"_id": "eiwF8xThSGkBi9mSz", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher and Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mc6D2pocTeXYiB5ph", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:07:57"} {"_id": "xAHYyJT9cj2bLcTbA", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nGLh2mtcqGR5qDCFS", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:51:41"} {"_id": "Gy22PRDXsN6SXFPrr", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "4CJiPWveNtz9BrnQr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:46:39"} {"_id": "6YNfh8zfSY8Dy2AqD", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHRr2Ash8xsJir946", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:38:31"} {"_id": "Db7tQR8KeNknLfF3x", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4cDXdg2Lprqktf2Pd", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:30:57"} {"_id": "kMAxY7wNwaRxkQjmd", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n \n \n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "p4JYisEfRMFCepECC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:34:30"} {"_id": "gghP3LYP3cbR48HuM", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome c : Class | some Teaches.c\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Mipegs7uPaD9WyjFt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:59:54"} {"_id": "HkkGzdbrm5Nho9TKh", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LJkxprLwzdcFMAkcZ", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:42:40"} {"_id": "R5uFPWJLu3ZtwJQBc", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | (Teaches <: c) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZEyNjpdjsNfrjjbP2", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:50:23"} {"_id": "rdk2MG8PLNSPpC3cx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tall t:Teacher {some c:Class | c in t.Teaches}\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r9DM62eCcnbm74fyS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:41:46"} {"_id": "hHxcW7FRePQEcyQtY", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { all p: Person | p in Student or p in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JJzuyGuA7Gcm7FeXu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:37:18"} {"_id": "yE4gJENji8DFyjsF7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tlone Student - Teacher + Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w62QzeQE6uFcoYhaB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:53:26"} {"_id": "zmfEQiuxDCekfTvMd", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "prnFiazeaRtjYew9f", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:29:55"} {"_id": "tEdntWAaXbryPJJms", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tZtCeTeYFbMTR7HwT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:21:32"} {"_id": "sAkMr27Gz78i3fvB4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher . Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3vaQF7qdinGYCpBJJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:30:05"} {"_id": "GPpaPbjCF6jDQqW8d", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7QRWHLD3bp9Bm6guR", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 710.4, "y": 132.66666666666666}, "Class1": {"x": 532.8, "y": 132.66666666666666}, "Class2": {"x": 355.2, "y": 132.66666666666666}, "Group0": {"x": 222, "y": 265.3333333333333}, "Group1": {"x": 444, "y": 265.3333333333333}, "Group2": {"x": 666, "y": 265.3333333333333}, "Person": {"x": 177.60000000000002, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-14 20:38:02"} {"_id": "bnMwnNg5EKTcosEHv", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Groups & Student \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YiR4XtEzxvSujCFBE", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:41"} {"_id": "FGtkuutcDRRTP4E6s", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-4-1 12:05:46"} {"_id": "AktXforZQ556qvMcm", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "XdnJ8KbDSqReAGKzN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:14:33"} {"_id": "SL8E7EuSRfmErY5QK", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "grJKTd7N2AyoqSJPM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:39:03"} {"_id": "MNHFQHXJasnGa9wfE", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YYRGbrrrEAF72MpbM", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:33:29"} {"_id": "QeSmeK5wsjbsGE3zc", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "vECMZq8QfCoZQtiwy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:54:04"} {"_id": "Fg2tffSuouuzPLqPB", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class - Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8KfXbpKEG7ZHhzGhp", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:02:37"} {"_id": "8DkBrAJ6RK3tG3JJz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jjc5fybWruKrjvTJ7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-2 17:45:35"} {"_id": "DctBdam2jWz6hKesB", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher or Person in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CcdRmR7sZwx3iEXut", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 12:16:48"} {"_id": "9zfDyxtMTeTbvxuy3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aftsuKKBKRsT7pZsr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:51:38"} {"_id": "R3jnTZAELSk3gcgjS", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s: Student | t: Teacher | t->s in Teaches implies \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ewTvcWfQ6vRfkg5KG", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:29:29"} {"_id": "Hyj5EGxaEkaAr9RAd", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Person.Teacher\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KZpBJFvsqvcRcBTGa", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:44"} {"_id": "e9kM5aqWntCdWBxBL", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => (some t : Teacher | t->c in Teaches)\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c : Class, p : (c.Groups).Group, t : Teacher->c | t->p in Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4efsZjyeSJ7ptnqWG", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:31:08"} {"_id": "ioBSN3DWLTWffKT77", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "QMdAMkDDQsSKE75jR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:56:25"} {"_id": "ZpzfhzMM4NzrTMHzA", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wrba6TgDXXSdzSQ4F", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:51:35"} {"_id": "aSnFa3neDFpDtJkuT", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mTdaGgCSKHof9caDv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:03:02"} {"_id": "skHkgfw7QL2YK7cHS", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors).Teacher)\n}", "derivationOf": "hhyZ7SwqCq8Hp8ZYG", "msg": "This cannot be a legal relational join where\nleft hand side is p . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:13:54"} {"_id": "nPcha7BJ432jARJrT", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "Gy22PRDXsN6SXFPrr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:46:43"} {"_id": "stGeHRihA5hN75JYi", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "DxTEcg234hQqgH5tN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:10:35"} {"_id": "3LdhFpf9gto2oX8vB", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "vBNAFGKW5PqZY9can", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:27"} {"_id": "pS2KXPmY3vQm7mfsr", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher & Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rLmPwdvxNocFhxWdG", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:13:05"} {"_id": "A8LFwmST3tTTsivQ7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).~(Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9rtFhiimN8TS5Wb7n", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:23:50"} {"_id": "CnPAmvFtTp4wGhXBD", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "P2ofTvBT47fAp46z4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:14:42"} {"_id": "BGmZhHWJ8naTkNcrq", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | lone c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "Zkr95fyTB8RsZSHgP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-10 15:23:26"} {"_id": "ZxaZKTFJHXmBBmToK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B42qKqg5NgvRxJocw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:43:49"} {"_id": "pZpqQE6vRAsSjHt3q", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { some Class.Student\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kh6b3CtCyDGFrvbYK", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:42:41"} {"_id": "gci6pFwj5p9PSheu4", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | some c.Groups iff c in t.Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q2TgpwBC3JwxXJeom", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:06:30"} {"_id": "5MwA5NJNsA28ebfPp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2XhdYgQf7M6uggB7E", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:53:22"} {"_id": "rARSTLqqduop2DBP5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "REcoAz8xAf4M2Zjrd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:49:00"} {"_id": "EucQXRfidbGiTuyBZ", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { Teacher.Groups.Group\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ziA3MrqhQwtJrhaXX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-15 13:39:23"} {"_id": "zJX2dsAkMLSNdSWr4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some (Teaches.c :> Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KD6DGYw52M9dC85Mx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:09:42"} {"_id": "iCR2NH9WtfRau2sqC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some s.(c.Groups) and some Teaches.c implies some Tutors.t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b6qEkRz5hpwXJ99Td", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:28:54"} {"_id": "k7C4cpK9j2cr79MHZ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 { all p : Person | Teacher in p.^Tutors\n\n}", "derivationOf": "2n4DmLGZoCKdPrdeA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 23:44:16"} {"_id": "mddwZyiuS5o6K8dBc", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LoFffiDm7gMNKMBYZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:10:34"} {"_id": "Tem7DC6NLF9pzJgfr", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\nall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:40:27"} {"_id": "3G5BRFPrYMReAirJ6", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c.Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PSZrf5A3Hv5x6mCpT", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:23:30"} {"_id": "PLgFGkBCeRby8t49j", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D5H3yaL5ptjAF4nHg", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:08:47"} {"_id": "Pgc6HaStmED7utgQG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tsome (Teacher<:Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p8sLK6Fca6HbqdxCY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:46:16"} {"_id": "rKk6gvg52jwk2Pp2u", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6gxevmiyS8TKDbu9W", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:54:35"} {"_id": "MJeiddY8H56g7FRwT", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w8LSh49NpqNQLNiqK", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:55:20"} {"_id": "cf5oTghTcDR3S9u8y", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one t : Teacher | c in Teaches.t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r76rnTrrwCNcrnL3Z", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:13:30"} {"_id": "zDfoMiHbYfojibarj", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZoGMBF5a4if66GdQy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:19:52"} {"_id": "goBNPLXtkppGHfZHE", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ThL9t8PQ2C62u2pgt", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:57:12"} {"_id": "f9ZLyrS4f6wwuuEMs", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n Teaches.~Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RirLaPMDoMAumx53u", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:44:24"} {"_id": "6afKHG35BvmePk3h2", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SH86P3yv5gAATe7eW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:59:17"} {"_id": "FWiuJou8ukhNpbHuS", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some (c.Groups).s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4EKf9FGBvfhbzNSZA", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 13:32:32"} {"_id": "kNfSPHJb5WH6ubCoT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Student)\n \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TtqDRxSiGbg7Q3Tnq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:41:48"} {"_id": "kW9kkh3qJzqdNPeNx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jzNWLhj8DXaxTSxSg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:07:18"} {"_id": "a5EjEoPWeeBxLfpgS", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall c : Class | some ( Teacher <:Teaches.c)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CW779Wkfw9YuaYYuC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 18:39:45"} {"_id": "2ceYjQcbkQcWDgq4Q", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "e4zSh5XR9uTZ3kzYm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:47:43"} {"_id": "xtwRmeWuGZj8P5C4E", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m9oGcYoHcX34iLo3x", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:13:17"} {"_id": "9G5v8C8SFmPy9JPue", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kT54H4JKhKBBmb2uu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:21:09"} {"_id": "GWuWwEhCYWiY9TfMJ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n some Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "kgyiNctrq5vhqq7xd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:09:30"} {"_id": "jXwmTZwjukXWESqS4", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class,s: Student | some (s.c.Groups)\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "s2Mk9nP9y8qQyS2Cp", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:37:25"} {"_id": "FrtrxsKvAhmzbMipQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | one s.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RGpsvp8zcKraKvFxQ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:57:51"} {"_id": "DXJFnCktKqeg47egJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | not(p not in Student and p not in Teacher)\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xx62MXHLmEQuqjDZa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:25:46"} {"_id": "Kw2pS6b9YL49ewMen", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | Person.(c.Groups) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cHSGfzmEuqNFcH5v4", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:42:53"} {"_id": "RR55kkTdEZHKA3N5j", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class in Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3GZZq59NDHBeFSPrN", "msg": "This expression failed to be typechecked line 65, column 2, filename=/tmp/alloy_heredoc3869212662990324884.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:06:31"} {"_id": "ovrWWJARqLNFZ2tYB", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone Teaches.t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QkimgrY2hKguX4gHG", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:22:11"} {"_id": "Gdom3xMQSSaZkqCWA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | some c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "yHDshpJEhEKAdTvqM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:51:27"} {"_id": "6DnnRX4QeTYqcabtn", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all s: Student , t:Teacher | t.Tutors in Student and Tutors.s in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nGJwtCa7E5g8fso9f", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:41:41"} {"_id": "syq8kZ5JdM8oygps8", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = Student + Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PXfM2KB5zxDwRc2tF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:05:29"} {"_id": "NNTzkmpJLyPdtrBhb", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "uZi4dhZPjkXLvHrQK", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:55:55"} {"_id": "G4HAE7xrgXruDSJdS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, p : Person | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "btw7BeNLT8zpuf245", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:41:17"} {"_id": "kR2T55WAzZB2v2NLi", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tsome Student & Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TYhEjzui8AFMoHkiN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:11:26"} {"_id": "AJGESKHLGYEfw74cd", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R5TAJY3RPnmsvx4mR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 14:10:13"} {"_id": "btw7BeNLT8zpuf245", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, p : Person | some p.(c.Groups) implies Teaches.c->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kWgpJnFubr7Bs9suw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:41:03"} {"_id": "wajupNhrhZWTnza7F", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o9msPS7RcwKyu75FB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-12-8 11:57:49"} {"_id": "m6zmG8ZQAxxseuFDS", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | lone Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JLnvgBkEDtGcBD2n6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:53:24"} {"_id": "Y6bfBS6WX2zwoKZ6r", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (p.*Tutors) & Teacher\n}", "derivationOf": "nHvgjjmPKByxkXMML", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:07:20"} {"_id": "ws7WHjY3WZvriMR2S", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Teacher => p not in Student || p in Student => p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ThXBgHDmZdc4eCe8H", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:18:53"} {"_id": "DkMrykuvZ5348bhqB", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n ^Tutors.Teacher\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:30:51"} {"_id": "tQSjjysGJzoZPWYtH", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone (Teacher.Teaches).Teacher\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8a5cQARXvsv8SZSTa", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:36:10"} {"_id": "MHZ5EsGGvuccDBG2Y", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\nsome c:Class | some Teaches.c \n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8bYih7uAr2YQuvwE7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:31:05"} {"_id": "DLYgDPpLpBDYpp6xN", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n all t:Teacher | lone t.Teaches\t\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tX5b3sR2GXrbo6pst", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:21:56"} {"_id": "HhchPNyfuxJfout6p", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tNo Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z92gHREHEDjdKZpKR", "msg": "The name \"No\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 18:48:16"} {"_id": "jLHcH5Qw8dpaQwbHy", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher in c.Groups \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bwmSFFijdfWDzaYRb", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:32:39"} {"_id": "5FjAWRuLLTB9vs6Yz", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m6sD2fWfCWy2WAptt", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:32:33"} {"_id": "8NMpXY8wBMAvKs3Ey", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.Tutors & Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JMCGsgMX6jCQPPisP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:32:03"} {"_id": "s3kDL9vqFvG347suF", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (s.^Tutors & Teacher)\n}", "derivationOf": "FzduriYfzXAXje2xg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:18"} {"_id": "HNifmMjZh9Q8r6ngs", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + no Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZRpjxL6bqb2tPAEK7", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:51:05"} {"_id": "ywL3wDcLrgyZTSqw2", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tGroups.Group.Person in Teacher.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KTqPB2QMFf8FwXnaF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 19:51:13"} {"_id": "6FggudsHWcvSeLdMo", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | some ( Groups.(s->g) & Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KkGQeC5fdwmfwS6t3", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:25:21"} {"_id": "dGuKkYX75qTiBoiQF", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GCpHhris4nqfRA4vT", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:51:12"} {"_id": "fJtLarrCyAcWmeDf7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NNC4YdnFrrxd2vTha", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:51"} {"_id": "Ycd8Mh2bYZLEE7awa", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teaches.Class in Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "smd7g6fbzmXSKbGbA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:04:01"} {"_id": "eg754gy7w837XCh9k", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in Student && p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HLnbyiP38ATkD9pFN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:44:03"} {"_id": "sGYiP5BLjAYaBtKYk", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:18:05"} {"_id": "YJxwwoZNCFSs9ecNr", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | Teacher in s . ^Teacher\n}", "derivationOf": "xftQFfLjnK6N9tgCE", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:56:48"} {"_id": "7FwFRGomWxeoBwoxy", "cmd_i": 14, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^Tutors & Teacher\n}", "derivationOf": "penRr82Wz5tJi2oEH", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 08:42:20"} {"_id": "XBqDTojjr7c9wZs7B", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J8T8jF2LkzmRy2Gv6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:01:58"} {"_id": "XBY3qA5Z3CjJHGi4n", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JyPuPXDEgPSyLRgna", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:05:26"} {"_id": "KLdRasQMfjaHE5ac6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P8RjjC4yr57b8Da24", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:43:02"} {"_id": "Cp7vQ2ruFnvvd2CBw", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - Student - Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RfXzAzs4H2Jfuxb2q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:34:10"} {"_id": "XnXbmWuSTj3SvrMDF", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fJtLarrCyAcWmeDf7", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 444, "y": 159.2}, "Class1": {"x": 222, "y": 238.79999999999998}, "Class2": {"x": 0, "y": 0}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 444, "y": 238.79999999999998}, "Person1": {"x": 444, "y": 79.6}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-22 22:36:10"} {"_id": "mTvPq5z6oQWa4vpFS", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | c.Groups in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G6LuzWxS5Fc49gwio", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:28:18"} {"_id": "ttczsueMxLaxSp2nX", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | Teaches.t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xBNZSzF4XvtbuHvNY", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:33:06"} {"_id": "gsBvXjgE95WD5EfH2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | no c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5WdtrfAeC6iPZmnbt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:43:49"} {"_id": "qqNRRgB7cgep6GjBH", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | one Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NPYAXoceGJwshLZh3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:53:59"} {"_id": "u9EDvxE5G4RjrsSGe", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "Xi6nPe8qmJoX2BGhx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:43"} {"_id": "prnFiazeaRtjYew9f", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n Teacher.teaches\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "amnih3TuotMnPWfhx", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:29:37"} {"_id": "4JxMzMfL4C8RDvXb5", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all p:Person | some x: Class | some t.Teaches.x\n\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "42yJK3LXKzYAZt7n2", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:22:22"} {"_id": "DPPECbnPATb3g3dYP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iFeB3nFn4miEjD2CC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:52:28"} {"_id": "DMBc2jqjo2smDzv8F", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = Person.(Teacher.Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ley3nPta7uqrR66LE", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:44:37"} {"_id": "5r4Gfkfvy7mnoKZcg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tStudent in Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bY795kcEBFW7aPSPK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-13 03:23:29"} {"_id": "isoJc628juTtKGguj", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : Class | some g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vissWLH8otdbwCLAK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:36:41"} {"_id": "xxZmZQj4j4PhHq3zH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yK6cgSmTETrt4TS6R", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 13:25:21"} {"_id": "TeZvba8pDFPyncP8Q", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some p <: ^ Tutors\n}", "derivationOf": "dy3j4wXGWsq54LDRj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:18"} {"_id": "n86peEWRXuCPNYojm", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gny6KFC8A9Lbs8Bpu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-27 11:02:42"} {"_id": "TPDCmvJjYxc8arExc", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LonDNoHnBWiJC9aSx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:39:19"} {"_id": "7WgNGYmjnn2EGinMS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s, t : Person | some s.(Class.Groups) and some t<:Teaches implies some t<:(Tutors.s)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gzz4HyQ2n2xv8twg8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:24:00"} {"_id": "Ms8WGsbLZaRJKdnTK", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Group | all t : (Teaches).c | t->s Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "eSDZrHBDSG3P2QwoY", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 00:42:29"} {"_id": "wTEKuWy669nfBS4vt", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => c.Person.Group not in Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "duzDvnLdpJpiCuPK3", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 23:09:19"} {"_id": "hn36AbMgDKmtmyTLe", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "erp3P5K7kntxw9byt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:22:18"} {"_id": "nYNyfZzCajJPFvi7X", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ((t.Teaches).Groups).Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "vNKxHJFobQyCJwinr", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:34:30"} {"_id": "nd8pMtcb6hsgC6npT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ua833YtDfBtHMzv9u", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:07:36"} {"_id": "yHw6YjcygGuKNT96o", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | #c->Student > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Svai3jZ7nMZ65ZHDc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:44:05"} {"_id": "hsK7NvzoXeQKGzEfC", "cmd_i": 0, "code": "sig Name, Addr {}\nsig Book {\n addr: Name -> Addr\n }\n\npred show {}\nrun show for 3 but 1 Book", "derivationOf": "Q57FQtvuEvGjWo2yM", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:27:16"} {"_id": "FSRACKij7283NX52G", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c.Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "38kneNhHxpamLpZxE", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:05:33"} {"_id": "RNtiu363qEpodtpxk", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-4-15 22:25:01"} {"_id": "8WSTqfXipbJA5Y5Fc", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tsome t : Teacher | all Class.Teaches\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RZ4PjCLLiwYhTa7dJ", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:59:03"} {"_id": "A9rJimFmqKhz8zK8g", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vMCsJn5jSTPDw3NAd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:02:38"} {"_id": "pHquBTg56ZyZ3RuSj", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c in Teaches & t->c1 in Teaches => c in c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wZrxNdFMxh2EvrGYn", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:25:34"} {"_id": "tCz4stLNAkxTSRAuj", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HJJFhqoZriCCoJvx4", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 15:01:01"} {"_id": "koCWxkhAfKhfdSp8P", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c in Student->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "35xcsF8F8Bignu7xr", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:29:21"} {"_id": "hqievd9snQN5FehwN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some s.(c.Groups) and some t.Teaches implies (Tutors.s in ( Teacher & Teaches.c))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xi5Rq9uxGyPx8ghAk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:32:29"} {"_id": "K3oGzRNqpjJR8nZjA", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Teacher.Tutors.Person \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ipXGNq5JFPGAfH2mv", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:26:21"} {"_id": "S3qr9RQi29hWpWDRe", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student | s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c9sPooG5PuNirKhnb", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:57:08"} {"_id": "Si9Bon9PkwC9nda3B", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teaches.c && lone Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "tER4HMX2rgXioFAxv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:21:54"} {"_id": "26C6GGZAqKuP63bTJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BPurxnaXporWMJr5W", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:01:03"} {"_id": "GK5cvhLhQECoYAgRC", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5d7Q26GX2EyxP6iMy", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:20:09"} {"_id": "9HgYvadiPc3LRLsNW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "pTyzxYDFpxwDHse9e", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:40:05"} {"_id": "qQNeJZCyeg8n5TeQB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "huNLu6kaqxLZKaJYn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 15:18:58"} {"_id": "hkTefAhdwcxA3v7GN", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NxjZeYDT39osY5Cym", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:10:02"} {"_id": "MCiEZysfGc3hFWoM6", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n ~((Groups.Group):>Teacher) in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "smrTDN4k8bv4xt38C", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:51:31"} {"_id": "kjTrqaakyHupfKzYw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DpDbrpiZf3FveJ8dm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:36:08"} {"_id": "DpGiCurnJdwjsxW8G", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AdqhJoMFPaQFwFcQF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:39:42"} {"_id": "vw5TPji3bJutJ3E54", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N6wscFSt9QyDXkFng", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 20:33:03"} {"_id": "EwRueX9yK5A4D73AA", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t: Teacher, s: Student | t.Tutors in Person and t->s in Tutors\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MQyncix5SJ5o4BazY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:32:39"} {"_id": "8E7NXEBg3pcaqgAzF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | some Student.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GPMFfFPTLsiRgeYq3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:33:54"} {"_id": "Kh7CZiYuQjiSKN4pA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p.Teaches = none and p.Tutors=none and p not in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "49xvpin5SycZEqS7J", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:08:13"} {"_id": "Anw8xmanfZKjGvYSu", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | (some c : Class| some (c -> t))\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mjKYLdLomv4FBQ7SP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:31:38"} {"_id": "ZdJHegQ3SXYHCJqLy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:17:44"} {"_id": "pMwbsv9CvBzNs9SMm", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:02"} {"_id": "KmHJXYSZtzWcHQxjn", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in ((Teaches.c).Tutors & Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JNpT2QgLrZRBwEyaE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:30:35"} {"_id": "mTXjing66MGKHB775", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "esz2go8CLj8sRymkM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:12:09"} {"_id": "bmd62nhwfQtPrLQZp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-2-20 13:48:40"} {"_id": "iTDEtu3SARohfay88", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tTeacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BE39ui4tdmPh6bJWd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:51:18"} {"_id": "FJRpKKm3hYkZde32j", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zFgkiN6HYtDcm7XEh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 19:47:22"} {"_id": "ThGZDuPbwDa4tSDHg", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teacher in c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n some Teacher.Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ATuGiPjQvw2N3n3w7", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:09:53"} {"_id": "hq8ZpBHS227Bdp4XH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zE6FJGboP8puDtCKM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:40:30"} {"_id": "Nb9uszvZbvR8WGJ3J", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-19 20:03:02"} {"_id": "c2AXewmyb7NStWFMG", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n Student in Class -> Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "SJAq9cufJ3sWutczN", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 12:19:59"} {"_id": "x8eZsKrwvXwXjd99N", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in (Student + Teacher) and no p.Teaches and no p.Tutors\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PFqTz9tbn4bDD9vwC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:46:18"} {"_id": "ht9tzuCvRMMNdCqLk", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s7K2HpKLmtHS3ao7b", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 15:17:38"} {"_id": "F7BsPpA8rcQRhyL5C", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student, c: Class | one s -> one c.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ND4dWXmMS6r8ociFz", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 18:04:02"} {"_id": "p8wLbR9bgHkwJp7FX", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s: Student | t: Teacher | t->s in Teaches implies \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NBSB8L4ymsbbREK9N", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:26:51"} {"_id": "BeuQe8sRE4NkSA8fX", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student |some Teacher & s.^Teacher\n}", "derivationOf": "FERx3D2YdSjGv8NGQ", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:56:57"} {"_id": "HeTpeYfyvZ3GqEtfw", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c : Class | lone Teaches.c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KfdyWBmjXWMeHAMZn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:13:28"} {"_id": "6ExcqvYsnkEZ2bnnv", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class in Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LMAD5ddfE9A8JfPLj", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:03:05"} {"_id": "yoK9vRpWwra8QaLuA", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | all c: Class | some g: Group | t->c in Teaches and t->g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xaoSeYrTww6wcExAk", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:56:31"} {"_id": "BPmgNGx7Dy3gBQjod", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, p : Student | p in (c.Groups).Group implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P3RGfqAhTCtMisJWY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:42:03"} {"_id": "YGuLZT7g9opgwLcp2", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KPZLNGYfDKQyd85XQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 03:53:11"} {"_id": "ttwFLbgBr4o2Hp3ux", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c.Groups.Student | #s.Group > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nnta94bhS4ABmsz2W", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {none})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:07:34"} {"_id": "baYrX8pKGmcgmfd4r", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | c.Groups.Group in (Student+Teacher) implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m3D6RfYyfPkbbgRa7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 21:54:56"} {"_id": "7KewLRdzoZvy8on3E", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uWzQu9JtwZYAquG4n", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:12:08"} {"_id": "9f6ZTM8SBBSnXWDcx", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-4-1 12:05:45"} {"_id": "H8ontPkwaMKX3cFfB", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Person.(c.Groups) implies one Teacher.Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2ES82nMDMAxBnfRXF", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:22:14"} {"_id": "zoKCTKuxXMPueTgY2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~Teaches . Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MuGEJeEi7chDRRHRJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:31:21"} {"_id": "QPMf5GZpce7cxSXBA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Teacher = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XSuTcHkBMJtnCp2fP", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:13:05"} {"_id": "HLpvLt3hwFoTyiSxh", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall t:Teacher | all p:Person | t in p.^Tutors\n}", "derivationOf": "LW3koXCfuYTTACHwd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:45:48"} {"_id": "evAP6Z4Dq7YvdM4Qs", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t#(Teacher & Teaches.Class) <= 1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9rGALWvJh6gP6FbFh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:08:04"} {"_id": "aP7wrXuT8M5DEzspv", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student\n \tTutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dMHJogRN4zasaxXEY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:46:24"} {"_id": "gttkub2TNM7FH6bph", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class | all s:Student | some (c->s->Group in Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kv7v2uvJWyXmPuAQP", "msg": "This expression failed to be typechecked line 91, column 34, filename=/tmp/alloy_heredoc8372982344221868045.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:38:44"} {"_id": "w9hvKhT3AbeWu96vG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher, g:Group, c:Class | some s:Student | c->s->g in Groups implies t->c in Teaches\n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LJAy4ZMCbFJNmhnWf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:42:20"} {"_id": "5JCY4uxx2zjt3dExG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => some Teacher->c\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pcxMpbEaqiC7pd6zq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:18:02"} {"_id": "nzE6rQhR8ezpr7k8b", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c and Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AJGESKHLGYEfw74cd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 14:10:25"} {"_id": "FmM7cMWMS2Nw8CTpK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches.c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KrBCGq8EbDDvEE48f", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 23:14:32"} {"_id": "b8jzrrjxbP9qkmXAN", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no (People-Teacher-Student)\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4qArCiP5zhrti3k9G", "msg": "The name \"People\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 10:16:59"} {"_id": "oMdquEMGx3QjZGhHw", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "B2Zdaed87RaDjAwjS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:20:19"} {"_id": "CGQbdaCbH53EsEXpR", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Person | lone Teaches->c and lone p->Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oHTxaPh7PtGzNbHRc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 23:00:17"} {"_id": "6qPrnm4xNtjfzz7Ne", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some Person.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "9Xea5iysfbddNCqPy", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:42:15"} {"_id": "bRarXQQetxDhLAkYK", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | some (c -> t)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qNrctsProPTCoFtYn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:30:52"} {"_id": "eCHAQYnY677oXZwWt", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L9kbe9vGn5ftLHwJw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:18:46"} {"_id": "jvveg9Q8HiF2X5XtS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "wsqR7dbLMnm9WKhbL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 18:25:19"} {"_id": "FKkqseBudtKLSTmhd", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "Aphp9A4oAFq9dd4n5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:21"} {"_id": "4eriHntwbvukYkjbu", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "39AKT46m3NkHSpCsX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:35"} {"_id": "DHzxvQpLWSRFJuHjN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "W7GHNj8ZYZru7mE9b", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:09:43"} {"_id": "E6KCx8FJXBS9xs6mP", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student,c:Class | c.s -> one Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hJvXo94Mr9WFhYNgQ", "msg": "Multiplicity expression not allowed here.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 17:17:41"} {"_id": "umRZ3K5mx6ccWmdRF", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some c.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7TwK7xjRd2Q8Nnsq9", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:02:16"} {"_id": "c7LX5SsmTtnfQdqWP", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Group.Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9vrHit5D6eavP5PKh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:24:29"} {"_id": "87K4ecLZB5soEzqpg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zBBRFCfjTcrrXs623", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 20:41:46"} {"_id": "RHYx7agoEjgzkFz2t", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teaches.c in Tutors.(c.Groups.Group)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "coqxws9cDGFxqEdn3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:27:16"} {"_id": "tKp2WmywuZ3aHQFkS", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in ((Teaches.Teacher).Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "adjA5Qe82y2L3J9wG", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:14:45"} {"_id": "eycY5Q4KrKT82KoZA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher | t in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HaRzxMxQFq36x2n9f", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:27:51"} {"_id": "zh2dPsYYcHECfwoAg", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Person.Teacher Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JNraTPkAtvxb2nDn2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:32:52"} {"_id": "zd6WSES7uMX28X2PX", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f9NgF9tgHFKcufCFK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:01:27"} {"_id": "fu6WBT4c6jWAvvSw4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ptGqTSLa2vXNJgtMK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:04:42"} {"_id": "D6EfqCC4sus2mvRXt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZCyoGNbmp9WLrM7gb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:39:53"} {"_id": "JjhtdqCfrnpGMqzF5", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c:Class | some (Teaches.c & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone (Teaches.c & Teacher)\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \tall s : Student, c : Class | s in c implies s in Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c:Class | some c.Groups implies some(Teaches.c & Teacher)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n\t(Tutors.Person in Teacher) & (\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EmYssgBmGbumwAKzj", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:04:55"} {"_id": "Ta4h2LBSGDpm8Sxdr", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FoytGxfTK3d9digbZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 17:28:56"} {"_id": "Wc4vF8H3x3e3sewQJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zffcbwEE2SmZszLWS", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:58:21"} {"_id": "yrErom9ZHtJZp5PaH", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent or Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "WDeSE4TCyzJwbYR8M", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:54:55"} {"_id": "62tkquRsfaSrMbNTC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dZhDuFgMLgsxigJf9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 15:47:30"} {"_id": "SH86P3yv5gAATe7eW", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WmufmFNLHYB3dQhLL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:59:01"} {"_id": "wJ3fASo5F6TZ9dCvN", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "fv9wqr2YjFgsrhAyB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:32"} {"_id": "BLuZAYYZsAhh47QMk", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y6Wupj5Bst4nPp2dj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:25"} {"_id": "wTBy2NwtKEQiWpkcm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9uZ4ggZthSm9WdJPN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:20"} {"_id": "ugN6mTYWnm8gC8SPg", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall disj c: Class | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors.Person & Teacher and Person.Tutors & Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ASWBzESLTWkZMXmJi", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:30:31"} {"_id": "BFgkiPCgG8qBgnTGT", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some c.(s.Groups) and some Teaches.c implies s.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tLmuzGNWvD2mitie4", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:23:48"} {"_id": "znYvQeYeY3t65G7ND", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c and \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "57C3H7KQN9Gc9JWiE", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 22:48:13"} {"_id": "3GpWaJGKukDsKmHGM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\nall s : Student | some Tutors.s & Groups.s.Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 11:34:57"} {"_id": "9HgJqPa7Y3QjE4C3w", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sbWm2joBGmg32GfHM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 17:10:38"} {"_id": "L2AxGxCftWreoCwYn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student | one Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DHJMnoA6eZ6ctBwN8", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:56:10"} {"_id": "9wxZAQhzjt9RTj7kk", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Class in Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EiqcG4wnY2Lys9GKY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:49:04"} {"_id": "kdginZ8AESqE5sWc9", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n Teachers in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MyCgDajiSQDifsrKP", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:39:53"} {"_id": "ti2sW2qCmcdKzsfyZ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | all g:Groups| some (c.g) iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aFo6xHyonoxqNJ8gA", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:36:47"} {"_id": "PwHwuZzsqRx2F5Fen", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | no (c.Groups) or some (Teacher & Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NxgjGCeAQkRWDhQNx", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:52:15"} {"_id": "ef6Li36NRnKEDqovk", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4uqYPQWaX3R5hDLXp", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:47:48"} {"_id": "RjLCkW8iyaqf86Dzp", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n\n \n \n \n \tsome Teacher.Teaches \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "KdqtqNNYBkp2Xx6Ya", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 19:17:57"} {"_id": "QW6Xw86PGHcZQy5Z7", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutor = Person.Tutor and Student.Tutored = Person.Tutored\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fPiJQcu8JnMpbEgQX", "msg": "The name \"Tutor\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:01:49"} {"_id": "DFnkbBdzWdHRZo5KT", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).(~(Teacher <: Teaches)) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GYbHvrgLTAixoqiFK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 21:34:58"} {"_id": "htNxzufhhF3mM2MPj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3cnSvdbvvHNGZ3YSJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:56:45"} {"_id": "5svvu6FqffcE4dxeW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c: Class | Teaches.c->c.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p: Person | some Teacher & p.^Tutors\n}", "derivationOf": "HnfCRSrxJQrEvd8L6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:09:15"} {"_id": "EYne5H3Kh6FcRAW7n", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t~Teaches.Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s : Student,c : class | some c->\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7pXQk7urp9r3hCi8W", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:20"} {"_id": "fNC9kxJwQFQvLmAGP", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wrwhj6HS2vuvtgroi", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 19:59:10"} {"_id": "CzEBcC9BTBvWX3L3J", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher | Class in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FiYi5XJ6PbJavxM4F", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:05:57"} {"_id": "Gzp2ALKN2PgkKEoyg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t Student = Class.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mTz2v926SXfdEKgXi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:45:48"} {"_id": "adrFy4CTZTSbe8MMM", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student - Teacher & Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "noZTHiFgkfhAgh3d6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:54:03"} {"_id": "5YvPf9gkwwA3DP7yF", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall x:Class| some Teaches.x\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all x:Class| some t:Teacher | lone t.Teaches.x\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JL9RmhgcqgwXFGBq2", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is x (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:41:19"} {"_id": "xW6QGexg67snqqWwP", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3hHE9xBjHqLPEHLcp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:03:16"} {"_id": "z5DbSYe2H5QGmaiDB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LkLYyoGeFsafa75ne", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:44:37"} {"_id": "mhucnkaW9nMPtm7Rh", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | Teaches.c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "cALBpCvWkfx8Q94kQ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:48:54"} {"_id": "Cw9Qoo3jfawvRgd4e", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "62WqtcMWjRtZNsH4F", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:24:09"} {"_id": "DndiH77YtuSYGZucQ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aKwqmJe5oScJPnoL5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:20:46"} {"_id": "nz75z6C9CSBNYcuhn", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pYE9CaZL7WtWR5PKz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 15:24:33"} {"_id": "pcxMpbEaqiC7pd6zq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher->c\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rZCczgKiYCXpfXrek", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:12:50"} {"_id": "ij9h3sBuYLd6ZJcjZ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teach\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qyfgT3jLaQavd9iD6", "msg": "The name \"Teach\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:19:55"} {"_id": "CW779Wkfw9YuaYYuC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nall c : Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 18:39:28"} {"_id": "vikJdEucYgEMLp3Px", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some ((Person - c.Groups.Group) -> Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LQfucNAnnHwh4xKrK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:57:06"} {"_id": "Riv5eZnvX2e4QNFEk", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) in Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "9iXK7xo3EoCKi8HmA", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:13:04"} {"_id": "9rz6BxhZiiaYBbKDg", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tno (Class - Teacher.Teaches).Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T5kJjs9xKw7dpCvtt", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-25 16:31:22"} {"_id": "t7YbjJe25KwNWLL4q", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xt58Cx8LivyMYaoXi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:00:45"} {"_id": "stwxRQf9JRuwk3NAH", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QzWiXZnsf6qWBwo3h", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:25:05"} {"_id": "3t6QvWaQXuKDJZCT6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D3qj4Qa9dNprqFQ7T", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:02:04"} {"_id": "4cG76KTQFF939XpGv", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class | some g: Group | t->c in Teaches implies c->t->g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AhFD97eSCn6d3AFD3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:57:59"} {"_id": "6y42EHzCSgcvnJzfH", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | all s: Student | s.tutors = empty and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "giuXiujAanZD29BoK", "msg": "The name \"tutors\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:31:37"} {"_id": "bhYK4HDRZyek7MZsX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in (Teacher -> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rw2o6ADGCTmvCJSgS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:32:44"} {"_id": "XeZBiQPKn4a7F7BKQ", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nrGZxsM4WdwnLqhsG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:34:59"} {"_id": "pkNAPpCzQ4uEvaA4x", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | some (Class.Groups.g & t)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "z7zh5PPoXDfFED3LB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:46:10"} {"_id": "56BJ5rHtYGRspQMRr", "cmd_i": 9, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | c.Groups in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "cdKaPB8sguHkrH67p", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:28:45"} {"_id": "y4SR4YSGFTbLeegP8", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no (Class - Groups.(s->g) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tMepZT6rpuQNgvJa8", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:21:41"} {"_id": "dWx5SLTkjsiEmz8WL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | all c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dNcqQYbi2gKvkWokn", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:43:16"} {"_id": "29tHhmxgQZj25WyRq", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p in Teacher \n}", "derivationOf": "YxK6np43wAqna7PMF", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 01:43:39"} {"_id": "9XEQCTrLJJo3FKL7W", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n\tall s:Student,c:Class | s.c.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xC5GApQMj9FXRSqks", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:48:22"} {"_id": "zGJA65pDEPKGDXZgK", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qKzdFnBgKxsczDSCx", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 16:59:33"} {"_id": "YJFMRpSuGzp9PFMhz", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.^Tutors) in Teacher \n}", "derivationOf": "YNXj46QGcdAyKg6Gf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:31:07"} {"_id": "6AgAp5YaZhmTnsmjB", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pwXqeqNa2CuFYWHJK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 09:25:45"} {"_id": "mtDwEbnb29YtoS4uZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ntZCcacDJ9aAqCT2k", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:38:15"} {"_id": "egJkfWbTYqfywNXtB", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class |all t: Teacher | c.groups->t in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hkTefAhdwcxA3v7GN", "msg": "The name \"groups\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:11:54"} {"_id": "CHRbHo5KcamDiSA98", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GszX2gdZbHovtXw55", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:15:43"} {"_id": "PXKqDxvP3tpqcbBnk", "cmd_i": 9, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Students in (c.Groups).Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "i9XoeqYK4YuRafSxu", "msg": "The name \"Students\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:43:04"} {"_id": "KZpBJFvsqvcRcBTGa", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r4ESJa6RENCqLzwvY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:30:21"} {"_id": "s7K2HpKLmtHS3ao7b", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "by3ZX6ibo8E5vBRgt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:15:30"} {"_id": "7SYsMeWf9Mapb4mSE", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s:Student, c:Class, t:Person | some g:Group | c->s->g in Groups and t->c in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rFeLpZKiwWEy8oqYt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:29:12"} {"_id": "HzactSbCJwJ9jbkby", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Person - Student - Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eRRSTHeihRy99r8G2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:07:23"} {"_id": "4tPHp6NMFTWpytJeg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gsTGzp9MqespnAxrr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:45:35"} {"_id": "xzNdEoxykA7hcLS8x", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | t.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w3wfgaZEME7exmuoi", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:01:20"} {"_id": "gWnfQdvDrZP8wvKLX", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class,s:Student| c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zc3ccFwcem39GS3Pk", "msg": "The name \"g\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:44:43"} {"_id": "HQhF6McvrsmT4KbzG", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher & Teaches.Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xu3TMJhXK53H3drgY", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:49:37"} {"_id": "8oPXTChkNZjFK9jES", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cuxPaYj3cEZSpo5kA", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:29"} {"_id": "DxYqj8XsGSzWkT5eB", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone Teaches.c\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oHruZxp7TP96waYxY", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 305.2416788736979, "y": 199}, "Class1": {"x": 610.4833577473959, "y": 199}, "Group": {"x": 457.8625183105469, "y": 298.5}, "Person": {"x": 457.8625183105469, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-5 09:47:20"} {"_id": "4sqqiDiZHoZDYYyYw", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tsome Class.Student.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qAgcWhq4swn5b7kbq", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 22:02:08"} {"_id": "XKCLx5bZCdkduCjt4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CHRbHo5KcamDiSA98", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:15:46"} {"_id": "FS6xtLBQugsszmwtv", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Person in Student and Person in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ERmxdaEKz5RRMZLmd", "msg": "This expression failed to be typechecked line 55, column 2, filename=/tmp/alloy_heredoc3286982110253839615.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:34:30"} {"_id": "ADSs4FWDYLFmfWuak", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \tall s :Student, c:Class | (some g:Group | c->s->g in Groups) implies (all t:Person| t->c in Teaches implies t->s in Tutors)\n\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "KNjvgKW8TvNewbbrp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 13:50:46"} {"_id": "MNYnRYsHhwcGbyEmQ", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all g : c.Groups | #g->Student > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vd3tWT74aejgQaJDi", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:09:07"} {"_id": "Z2tue7Cg4Ls4zpssH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class | all s:Student | s in c.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N2BKo4ttEbkGMskQP", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:38:08"} {"_id": "jqfSofikhGwNCLKtK", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some Person.^Tutors & Teacher\n}", "derivationOf": "qiCRG4tpN44pR6ig4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:09:31"} {"_id": "zpCjfEgkdn6vfWDjP", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Student in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "stwxRQf9JRuwk3NAH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:25:18"} {"_id": "rzYauwR5uZcLRy6jJ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | one c.(s.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 18:37:22"} {"_id": "Y9553KTKHo9LDyXgb", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) implies t.(Class)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6bqp4L4xg2k4ue57m", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:54:49"} {"_id": "kKgDARv2WbnaEfAn8", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NRKNjfvAcPdNR6Qgo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:17:05"} {"_id": "vRtnvxnQGy5HZsJaK", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some Person.(c.Groups) implies Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tcs3JeLQwmYncxpQP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:12:58"} {"_id": "HkNsYWKfvhrLFmHZE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . (Student.Group)) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q64TQB4uLDeb8Xsny", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:57:01"} {"_id": "FzduriYfzXAXje2xg", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Student | some (s.^Tutors & Teacher)\n}", "derivationOf": "iD6eEoJMGJQgYjm8o", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:04"} {"_id": "Qj7di5ueZ7ZisrRzb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies some Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DZTddvfF5kLCFTkgn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 19:52:43"} {"_id": "49Le6dBffjD6dkyj5", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qZ7qwfPijQSkdb8XZ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:10:48"} {"_id": "btxRsv5bY8fv6LK2N", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some (c->s->Group in Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^Tutors) \n}", "derivationOf": "Ncute8vRttGioGhLf", "msg": "This expression failed to be typechecked line 90, column 34, filename=/tmp/alloy_heredoc4765184132419377631.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:55:49"} {"_id": "caBTRXpAMjWAfH5qq", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KxMiNciviL2S9SDNN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:39:11"} {"_id": "FbTpRv7wmi7BLdRyd", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n ~Teaches.Teaches in iden\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3TWLDCRQwGjvf37Rc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:38:36"} {"_id": "pJ7gFSFGwueowhpot", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BLuZAYYZsAhh47QMk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:27"} {"_id": "d2qW43o3oDxGbKJkN", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | c.gropus->s in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LhtbDctLTqxKCHCeb", "msg": "The name \"gropus\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:22:39"} {"_id": "Hyruo6oHtv7y9pneL", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | lone t.Teaches \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XhLEJntChbzCoL8TB", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:50:44"} {"_id": "s76459YYpjWLCTAvh", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno(Student & Person.Tutors)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FevdpoMdfyFWaNHcr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 18:38:05"} {"_id": "MnPqr2nRmQkA9TDXD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies c in Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qj7di5ueZ7ZisrRzb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 19:54:00"} {"_id": "xbz5irKEwAmY7C79r", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6LXwQZKMWvqN9mLWq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:51:46"} {"_id": "a2fKLsQXmj7TDzFvc", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p : Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno p : Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FzXpDhSfWrSYSEKQo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:33:42"} {"_id": "E6JR2oranuJwGBsZK", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xxsQFNLW3th4kDC8e", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:01:48"} {"_id": "evao3N9oR9sqzKbn2", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => (some t : Teacher | t->c in Teaches)\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c : Class, s : c.Groups.Student, t : Teachers->c | t->s in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bm6mny3QKPdKMEoJy", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:22:18"} {"_id": "Dmd2BjW3thcAKNQHf", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) => (#(Teaches.c & Teacher) > 0) ' #c.Groups = 0\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5v3k6ghKk5PoozWCS", "msg": "This expression failed to be typechecked line 97, column 66, filename=/tmp/alloy_heredoc11210858614701595205.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 22:37:03"} {"_id": "nTAezo6fYJSNf3Bii", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student | Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pEZypAgFXpw9ChXDi", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:21:39"} {"_id": "WScid3xfHYHKH7qv4", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teachers in Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yyo6A4eMBoYJZWjon", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:07:41"} {"_id": "NyGjsqoq3X5uZdzoH", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 in Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "okhQuNimHnpdGPGRN", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:17:46"} {"_id": "pz4Dmq8CbLaPKf6rq", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6cbPETK32MGrZs8A", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:07"} {"_id": "gTfeigQ5EEH62KAbA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y3wmbmggDqk78uzsM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:47:31"} {"_id": "zYxxwyT74tfJebsSj", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome c: Class | all t: Teacher | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kj7zA4EXk7XAR8eNj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:16:38"} {"_id": "4AsC978sPXec3f5ix", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class, t : Teacher | some t.Teaches.c \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wDM6Dy9FDsWw3jGPa", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:35:30"} {"_id": "66aDc8KLsfuG4KuK3", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "mTXjing66MGKHB775", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:13:01"} {"_id": "EJByffBAKocgye2eF", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tPerson.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NhLfYQyGa9HQpdCta", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:41"} {"_id": "mmqDu7ymqKYLAk4M6", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gd4QPxDb3RX6hzbga", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:08:15"} {"_id": "aJDq7P48wDnJhzqD3", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | some (Teacher.Teaches->c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "wXgN7fdsZ7jbTKzTY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:52:56"} {"_id": "FkhYNR7GaeJxhq3eM", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "km4Hc7tepo9sE3a4Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:04:58"} {"_id": "w24Czr9dbCAx5k9YB", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t(Person in Student and Person not in Teacher) or (Person not in Student and Person in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mR4BQTfoGuJ2eGBop", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:35:11"} {"_id": "3xppnbX7bMq9Asoe6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some s.(c.Groups) and some Teaches.c implies Tutors.s in ( Teacher & Teaches.c)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iCR2NH9WtfRau2sqC", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:30:18"} {"_id": "wwue8XZAs3kjY9GzX", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone Teacher.Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7QRWHLD3bp9Bm6guR", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 20:39:29"} {"_id": "JkPmbACXZvoAZg6bQ", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher |\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "Qndh7uCAkQFeaKM98", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:13:49"} {"_id": "SyXv2sB26vkQJzrAc", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t : Teacher | t in Groups->t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HjCen7KKmX7MMDhWD", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:30:45"} {"_id": "Cgg7MTwM7tYxHnZSb", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student |some Teacher & s.^Tutors\n}", "derivationOf": "kaEqe4zXfYCLQi8jn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:32"} {"_id": "syAgRaZTkn4GoszTj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class| some c.Groups implies Teaches.c in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L4AxyZrvx8Csvyhzt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:49:26"} {"_id": "8uRZ6HzWzt9XmT4Fq", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7X8eneW7kFhS6F6Wv", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:16:11"} {"_id": "eDGEpXBox9EF7tzsP", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3RivMFneHTvQzcfs2", "msg": "This expression failed to be typechecked line 96, column 31, filename=/tmp/alloy_heredoc10614993557783573295.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:00:06"} {"_id": "cBaevy4zbaoTpG8Qv", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p1,p2:Person | p1 -> p2 in Teaches implies no p1\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SgXZiXxeXBSwpCHzq", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:45:11"} {"_id": "6ArNqNARHg8DTaroE", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher.c & Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "paLnpQ4Rt94i8AsFW", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:44:45"} {"_id": "bYXZ7FiLfJ6hXipgK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches + Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WSyE44LqRg6kerFaL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 18:33:56"} {"_id": "zAv3Bk64xkxtN68iX", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class, t:Person | t->c in Teaches implies {s,g: c.Groups | t->s in Tutors} \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "z3kqtFQJAnTcbwaQn", "msg": "This must be a unary set. Instead, its type is {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:48:11"} {"_id": "2QScqaqLKoHjFFtrv", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tsome Person.(Class.Groups) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4hmxMCt4ChSEvge9p", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:39:32"} {"_id": "P3RGfqAhTCtMisJWY", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, p : Person | p in (c.Groups).Group implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uAezNErGvTaY6irpj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:41:52"} {"_id": "sz5pS9RHtr4sGkwyD", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s :> Teaches.c.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gdeDcpmjmD43DgeHd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:28:56"} {"_id": "b5MkH7DtDptJ32ykq", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CfJQfgPnN9RBPKoR8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 14:58:27"} {"_id": "RHwRSmGJN5aduDa8r", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PZaDrji4qSAhXSoGx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:12:49"} {"_id": "HFDvFYEE2TWdChKvo", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MkhRP8ijNfKeFWf4E", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 16:49:40"} {"_id": "mbmKguBHecugFp7wF", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w7QHpuEX7nuBNj3QE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 16:02:33"} {"_id": "zAZFMi3PoHTn7jcsL", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher:>Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4GqLBRBAXp8rYzERY", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:21:17"} {"_id": "yFm7WNJkuHCtv2H2L", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups) implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XQ2tDyN58Y6bcPhrP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 15:52:11"} {"_id": "FxD6x7rhADsqzdLMw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3HuSsyeCzYuYjrHr3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:48"} {"_id": "5fZpLaYAbT8XEXEeR", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YYRGbrrrEAF72MpbM", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-12-8 17:29:27"} {"_id": "9vrHit5D6eavP5PKh", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6NRo92byZLAiLrwMz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:23:06"} {"_id": "oPqRHwqib2jvoiQ6D", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qZzwF4t4j77JQMwNN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:10:58"} {"_id": "3YXKcAgLnByLANkJe", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone (Teacher & Teaches.Class)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HQhF6McvrsmT4KbzG", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:49:48"} {"_id": "7t586znP9eFXBLfiM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Groups.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EA6NaAKHjJ4pZT2HK", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 15:25:44"} {"_id": "w9JjWyTLGGZZ9p8ko", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "wwEGdbzNMmXz7vepf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:57:05"} {"_id": "PBnSBiJcgrypsY4Jq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class, p : Person | some p.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ehHEuZyw5eH2DzcNi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:35:56"} {"_id": "iD6eEoJMGJQgYjm8o", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Student | some (s.*Tutors & Teacher)\n}", "derivationOf": "GQQFHX4vFXGvokdP4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:51"} {"_id": "ubf7EidMH8oYHX4HP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zp39hDQYFJmBNeCaF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:55:22"} {"_id": "jytJcTCFx3wBXnehm", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person implies p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C5HEiWXd74ZPu4kxc", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-2-24 15:28:44"} {"_id": "iTFupuXoRSjSWnRJu", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mXw4S8wYydwtZ97TK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:00:29"} {"_id": "ss8jhQjDFaNniCfq8", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone((c.~Teaches) & Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (c.Groups) ) implies some (( c.~Teaches) & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "gn6r3NZvNWDTtFq3a", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:53:25"} {"_id": "xR7mWrASppsZD8HuJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6WQmbSnMWx4fxGk2H", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-2-24 15:26:58"} {"_id": "qfKjjLNcMLtx7pJeo", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nPerson.Tutors in Student and Tutors.Person in Teacher\n} \n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 { Teacher in ^Tutors.Person\n\n}", "derivationOf": "Sz45AReFtTf5LfYFB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 21:20:34"} {"_id": "rj9DM22TEfg3kWYYA", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c and Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ZMBtGxwSPhig9fcE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:14:02"} {"_id": "wcsNEKN7nhQx5fdeg", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "uwrbGNk8ou6JBvpDm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 22:48:06"} {"_id": "o27rDBZL5hv8rv4SN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | c . Groups . Group in (Teacher <: Teaches) . c . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RMDpFDkWq8DTP5oRf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:31:11"} {"_id": "XL6pnh53rgsnyBhq3", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zd6WSES7uMX28X2PX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:01:44"} {"_id": "GbycPChxhh8oiTjE9", "cmd_i": 4, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n\npred inv5 {\n \n some c : Class | Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "YscgKPT7g7wPakLKz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:00:21"} {"_id": "GufaTeNQevpefXxvz", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | lone Student.c.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YN2oth7iJmY68ixor", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:25:21"} {"_id": "vMCsJn5jSTPDw3NAd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tClass in Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QzqPXSrLgva7hT3zd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:02:14"} {"_id": "bM6fNFwL3ynKafx7p", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "etrKZ88GwkHEZSQer", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 18:33:26"} {"_id": "gQify2wESAmfyhMwy", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Group | (all t : (Teacher <: Teaches).c | t->s Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "5Yn6YTgg8HttTticR", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 00:41:51"} {"_id": "h76ws9XMoW4vYfJGR", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \t\n all c : Class | Teaches.c in Teacher \n \t\t\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \t all t : Teacher | some t.Teaches\n\n \n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "Cqft296rLfvPon5bc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 19:25:07"} {"_id": "f86Z9ph4Lk59sRvnC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yDTxe7vkcWNerQTTq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 21:12:45"} {"_id": "qnMnrLDq3LM7dc6Dd", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student & Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRfeqWf68ZQzsG3tZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:11:20"} {"_id": "CB5vNf6fmo6nAwTXy", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tg9QdzurzLkyq4NCS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 10:18:44"} {"_id": "iHmYqf2a8FQkPssF9", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "264cw9NjH7zvMGQSQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:40:41"} {"_id": "a9MF9Csaqn6Covobp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "ioBSN3DWLTWffKT77", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-19 09:56:32"} {"_id": "E5kEhbb2GvoRvxWJS", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t:Teacher | t in ^Teaches\n}", "derivationOf": "n9QpWoSbuYfgqaJFw", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:43:51"} {"_id": "2JQJyH68S64wHk7yB", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | c.Groups implies (c in Teacher.Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qRDCYRzZtWjtaWprk", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:51:37"} {"_id": "Gcna5WDM3arN3BCsy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student and p not in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F7xvPYSeXx2Sjsa6N", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:32:20"} {"_id": "njYYKJvb2QNhbtAdJ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T5Wb4DyXkKN4wrDQC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:02:21"} {"_id": "DXcwC3TNwED6QEKsK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tno (Class -> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MRiyDRxSaMdgNtasB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:57:57"} {"_id": "AdSvszCBCNCTAzpHq", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Teacher.Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7gFKZzHBys6s5E3fm", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:33:36"} {"_id": "K4gzJnGAqERoW2JjB", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { Teacher.Tutors and Tutors.Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GjxczyzXeMdArsC84", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-19 19:57:34"} {"_id": "AqLg8saCjLMDY3LRc", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies (all t:Teacher| t->c in Teaches implies t->s in Tutors)\n\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "ADSs4FWDYLFmfWuak", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 13:50:55"} {"_id": "Gzq4BCh5CBPuaTwJ5", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Groups.Class implies ~Class.Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pCm4M96u2EgRyA3L8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 23:01:57"} {"_id": "bv8whghHMRugs58co", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | t some-> Class\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FBrD5GvXq6HjYLMZK", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 18:16:31"} {"_id": "5d7Q26GX2EyxP6iMy", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X8T2q4v7Nkt9MyGok", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:20:06"} {"_id": "dzBB9hLCvcfrzftHB", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | Teaches.c:>t implies (some Person <: c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8iq3nsXBoeuba3iCh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:30:02"} {"_id": "nX792mizTBWboFvXB", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | one ( t & Class.Groups.Group) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "EWXhHSPdfrPGby73Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 23:24:40"} {"_id": "5ch8jgQNopB24jnKK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t:Teacher | lone Teaches.t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AGSFRtWWjW3cETWqh", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:28:21"} {"_id": "EreQMrGTFgfyah5J5", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies some Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some groups in t.Teaches \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TbY9n6LzHkTXzqyjn", "msg": "The name \"groups\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:47:36"} {"_id": "wHjMb24Ktr65hPsGY", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c->Student, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4tPHp6NMFTWpytJeg", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:48:58"} {"_id": "EXSbLgYY8ry7yfSHs", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L2AxGxCftWreoCwYn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:56:21"} {"_id": "Db2vneq2g58aSk6sF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c:Class| one c.Groups.Student\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FuywABrT5W3NtuohN", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-8 17:20:29"} {"_id": "2kopGxA353ZXXFmNb", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9kuLaratwkghWpXMh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 22:17:16"} {"_id": "qEthjefuSPhxmTKQQ", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = (Class . Person.Teaches)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kp4N6ZG95yuwzDBcD", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:40:44"} {"_id": "PRqJoYm8K8RBDcu3F", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n Teacher.(Teacher.Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t5fv8WMGKRac9GARv", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:32:44"} {"_id": "r8MyG8YKqirxpWLBo", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dq6NffXHrMdZwxMub", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:41:36"} {"_id": "MR7J5L8RXLWzjxtof", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some c.Groups implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u2JP6zHCaNw2iZGpW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 20:09:01"} {"_id": "J5yXPzMkm6KewnxPp", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c:Class | some (Teaches.c & Teacher) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone (Teaches.c & Teacher)\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \tall s : Student, c : Class | s in c implies s in Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c:Class | some c.Groups implies some(Teaches.c & Teacher)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n\t(Tutors.Person in Teacher) & (\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JjhtdqCfrnpGMqzF5", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:04:59"} {"_id": "pFS9RQRRQQWfAx5JF", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Person.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y2d3SuRDHuDr98BaX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:40:07"} {"_id": "b3FdyqZahqoYohztF", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | Teacher<:Tutors in Tutors:>Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cd8CrDKgRbBvgNRhC", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:40:37"} {"_id": "jBw2pR4qRo9eRpjnn", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ou5CErjiAKGoNw9ip", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:09:22"} {"_id": "gNmhNHtPfu2B4yemq", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Teaches.c in Class.Groups.Group)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xHfpFrnQeqn7bDvJb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:24:00"} {"_id": "fWdkPTPMnT9z2uh24", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "f8bp38ti22CMt2nGD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:50:44"} {"_id": "WntRjhAGXsp29WeST", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | some s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DqokYkk7Z92SZ5atR", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-10 15:36:13"} {"_id": "uPuxdFdgDh6b7yg9z", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all t : Teacher, s : Student | some t.Tutors.s\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kc4KJGjJRSvCMqMJz", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Tutors) (type = {this/Person})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:33:38"} {"_id": "23kiwjSSi2zPygFiS", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | lone Student.c.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xaKwZ4oTjQAbut9Nr", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:25:12"} {"_id": "BCptAY5PkmhXBvijY", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (c.Groups) and Class in (t<:Teaches) implies Student in (t<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9iBvXxXTMYA4oRAfw", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:17:06"} {"_id": "3WmxtL7qAkh8zYTWo", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "su3ZirP4qN94q2eM9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 15:54:22"} {"_id": "ttCFXghmFCv97FZFL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:53:22"} {"_id": "s3GQSdAWiAt5JYDpo", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person, c:Class| (some g :Group |c->s->g in Groups) implies (all t:Person| t->c in Teaches \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t implies t->s in Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "zvn3e7Pm6NbbnNmNB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:13:02"} {"_id": "SHNF5Tf7NdPjhqzfr", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TktdG7TnGxSrZasw3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:36:58"} {"_id": "4HCx9iQjjtocy2LGt", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4XNajYD6W74pM6gEY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:54:12"} {"_id": "t4z4G59uHdqwiJxNf", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yvexDdFZxH3mKwL3K", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:41:21"} {"_id": "gZaPCwPBvv3xKgjJG", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c -> (Class.Groups.Group & Student)) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nCXdRjDF3vhAbfLcY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:31:21"} {"_id": "YvRWg5SR4A8h8Mwk2", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Student.^Tutors in Teacher\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:37:40"} {"_id": "N8WnvN2n3tRMed3Ei", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher in s . ^Tutors\n}", "derivationOf": "wLTzT8g4DHo6cJJGD", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:58:24"} {"_id": "F23whZxbsD44dhRxa", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zwbNjz2SXo3bkYaTu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:52:14"} {"_id": "xHfpFrnQeqn7bDvJb", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Teaches.c in Groups.Group)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kFCaiPssWP4Z49bZM", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:23:48"} {"_id": "6h4NoZuoxhTEDCTo9", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t all s : Person | some (Tutors^.s & Teacher)\n}", "derivationOf": "WTjBLoq8KzS2jW4Lb", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:50:35"} {"_id": "N3pA4AiHKukbAhZss", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ot6mpgZuvr3Cy78Ry", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-14 01:44:18"} {"_id": "FxsutXcMHAMLPhyaS", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rKk6gvg52jwk2Pp2u", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:55:22"} {"_id": "pg7HEN5zdmrqddZtG", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some Class.t\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9bfqdPiPWAHksa6NN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:33:40"} {"_id": "6DTrfkkWgc3H2chgY", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student and p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nFYg549xWRkttAXW8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 20:48:26"} {"_id": "JLuYkuX9A7vpFf5wK", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vYLZSD44G4x9MfEhJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:35:33"} {"_id": "ouddEzsAXQSRK8qgh", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-7 06:45:36"} {"_id": "rRvjT2MyYb3LGWcQj", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tnot(no (Person & Student) and no (Person & Teacher) )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KphM6wwcGwcTEfLyr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:34:21"} {"_id": "nrsmmL4bECTDbhyqW", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | no c.Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jCMsmaqrzNDmQ6F4T", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:13:19"} {"_id": "tBphzouEMMqdtN3Ci", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (Student->Group) in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "evjpXtg9KkKbgaDx6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:31:05"} {"_id": "aBw8eYb4dZGe9Z4Hy", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | some c.Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nrsmmL4bECTDbhyqW", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:13:32"} {"_id": "sqXHpBRpnRrBmaXBh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | one Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RHwRSmGJN5aduDa8r", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:13:05"} {"_id": "yRE9uSGN62MZH5N4i", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some g:Group iff c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k5mC3pfqNdYD9Cquo", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:24:50"} {"_id": "G5yB5CNw4YrDYiBsW", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher, s : Student | some t.Teaches and no s.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e7x6i63J4pdQFnTZt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:03:54"} {"_id": "ywcennTMaYux7iNDL", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FHm9sCA5oKrsR6jGW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 14:56:20"} {"_id": "KNZeLWMFhWt97zexb", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in (Teacher <: Teaches.Class)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cryZWpmJixRhXCcHk", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:40"} {"_id": "e8usCsibdWDLumf5s", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p not in Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6DTrfkkWgc3H2chgY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 20:48:52"} {"_id": "EhC6FniPSsvWjbiDy", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Student)\n \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZxuHxBWE7xQ7f2eJn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:42:26"} {"_id": "p2kmfsnHehmAmw585", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TRNiYaC8vsWhzgtPm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:41:36"} {"_id": "6CSsX5ZCBmpK7Huxv", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | one g : c.Groups | p in Student implies p->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HiLEYJhaQf4TCQZKL", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:14:56"} {"_id": "ZbmMip9RTX3bttSb4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher<:Tutors:>Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m76yrXb83JFKMnAcb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:03:59"} {"_id": "Zmktz3PeTfhzeCJ5Q", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tStudent in Class.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZfBNJDnBLcMyDktLA", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:45:35"} {"_id": "XwtCDoeiCDDg7XgpT", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "f5tmqwXjZKMnmTQxj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:19:56"} {"_id": "skNign8hDPNpgtLdC", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8ouCt4iEBPdKWwAjL", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:21:37"} {"_id": "596rGGDrT9KM5enfM", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Classes in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rPLtFpNgL52Qyy54r", "msg": "The name \"Classes\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:29:53"} {"_id": "ouQMe6JvckE7gZcJv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Student.(c.Groups) in (Teaches.c & Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qEHTFm3mCb57gm5yG", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:27:21"} {"_id": "k7c8n4ugEgBA2h2Ya", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C4iz8WMiNTJPhyYE5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:45:09"} {"_id": "y8TYfYuQNd7ErqfMP", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { no Teacher\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Go8MhoqWD4Rrr7KyT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 16:34:55"} {"_id": "uGkzvbgqdTecBh6LT", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ppNGxGaD3SYjqpKsL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:42:01"} {"_id": "RkzqidZ6vbg6DvGA4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tClass in Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uGNqpqbFaDDj4H8qK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:31:33"} {"_id": "gGsoMLEYxTNjdh92k", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Person, c : Class | some s.(Teacher<:Tutors) implies some c.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gkwsaeGqtAQdPf3Fp", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:04:43"} {"_id": "z9mdESq2bMGBLLpBX", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnot Student - not Teacher = none\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3Ru64ZSJQLQRubZLv", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:27"} {"_id": "WGHFbDuCgswXCf7i6", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "KMSos9Xz59WDKxt6J", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 10:02:07"} {"_id": "hQ65ZFd5jxY8Xf5bh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b4eWHb6zMutZfeHbu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:55:42"} {"_id": "x6FvfjHtk9byCMdyz", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CM7LBz5iWGSuxqbET", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:20:48"} {"_id": "8DTs5wsyXxnwSwSsk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "d54yd95PMT2qR5Lax", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 09:58:55"} {"_id": "TgNpuhyQeSoENYkZn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:49:29"} {"_id": "9oYYE2SN7ukMyt5ZK", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RCaB7kiQeuHKPRKPL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 02:27:25"} {"_id": "PmpNkaukbX9K4qmXn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { \n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher and no Teaches\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6oZ8YYWk4Ajde4z38", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:35:32"} {"_id": "rdsHB7JHZPJ295Hay", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups.Group implies t.Teaches = c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "opFYdj9ni8aogEhZh", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:49:30"} {"_id": "xjeNbKtx7EhvPkF2L", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aq3hkgjp9r5XaYgHa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:23:44"} {"_id": "3qm6ScyMPWbWQFqQb", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson - Teacher\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wKDEw9BHhLd6HA9Qi", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 18:20:56"} {"_id": "E7C7oBCGyMgoqukNg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gef9WJtob4ommkFFc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:41:47"} {"_id": "DFZiZDXDCtANqKa2F", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teacher.Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eDGEpXBox9EF7tzsP", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:00:35"} {"_id": "ugwdAPEsCBWjTEhzx", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h5pHJK3W3Et6PAK5B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:35:05"} {"_id": "ChTnNkuPhznPcANdA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).(Teacher<:Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YsBfaAgZt5cNcSoiR", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:12:01"} {"_id": "j3aRo6Zekk2WXbKpu", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | (p in Student and p not in Teacher) or (p in Teacher and p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gcna5WDM3arN3BCsy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:32:37"} {"_id": "iqTArNLBKcqJjJsRo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (Person - c.Groups.Group) + (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AEdGkFWzjJt6ETrKM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:48:22"} {"_id": "QQHLR3M3bvbcYaWgX", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome classes\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YEpLgfx3QgtqET5SD", "msg": "The name \"classes\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:17"} {"_id": "iKHiR2WvJX8JTF8tE", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teaches.Class).(Teaches.Class) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jhhNkaaYESDpCmMsR", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:57"} {"_id": "fNrCwKPfQQfmLkgRD", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bh6hvGvXGgXgcfYDH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:07:30"} {"_id": "KJLpnX6yniXH3RLGS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s: Student | all c: Class | all t: Teacher | c->t->s in Groups implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "adytF98xHdcZSAXx2", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:19:03"} {"_id": "tyjPRok6h5DeMxoNz", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c and Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nzE6rQhR8ezpr7k8b", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:11:35"} {"_id": "9Mp7CKjdZYF8rv6Cm", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | c in Groups implies Teacher in c.Teaches\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YxT52FZTdaQvXHtwd", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 14:52:13"} {"_id": "pLGRHASHwEqeSBxcc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | c in (Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F4nXinZgqSPRX48F6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:07:51"} {"_id": "AtaKJd7e7ZRmcHtxg", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher, c, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n\npred inv14 {\n \n}\n\n\npred inv15 {\n\tall t1 : Teacher | some t : Teacher | t1->t in Tutors or t1->t in Tutors.Tutors\n}", "derivationOf": "2DiATPwt2BGRwzHo3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:20:24"} {"_id": "km4Hc7tepo9sE3a4Q", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher | lone Teacher.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R772NpL4tmNPEDBSp", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:04:55"} {"_id": "dx8iBKMB8tbBEDauH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RAmFTPFNHh7DLo5C2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:39:29"} {"_id": "LaBzsK3jtPTeqXwna", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher, s : Student | t not in p.Tutors and s not in Tutors.p\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sw7KG7kDP5AR8bwCx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:41:00"} {"_id": "ZuYHJiL7EhbakYCwg", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "KH2YSHmXBroKY6re4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:55:22"} {"_id": "XTpmR6NyhdRpdpzTN", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some Group.Class & Class.Teaches.Teacher\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:00:06"} {"_id": "yakXt9jv8DXZ5ESQA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "fYC4Eh2xruLzF5r5B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:13"} {"_id": "cNwLrrYC7jbx5DW3f", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = no Student + Teacher,\n Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bKLypkkRdSLSdMw4v", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:27:21"} {"_id": "hZETk564CJFLn6TnE", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Teacher.Tutors and Teacher in Tutors.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9aaKrJfoxkZDNBWFE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:24:13"} {"_id": "phpiLFkaoKjr7TBoW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "f3v8A4ga82QfASirM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:10:51"} {"_id": "2ZoqQi8G6w7BZwe6z", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KHcFryWfuqRJWCett", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:09:13"} {"_id": "kQ6tE2G4vY5d52rMZ", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bpEbFKScCt22zrDZK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:24:26"} {"_id": "xMn4dFtWqpE7uLpAu", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e8usCsibdWDLumf5s", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 20:48:57"} {"_id": "dKsnT5Qbcjqdvb4kf", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qSTFaFoq3xNERTfyL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:49"} {"_id": "nHRheKTwEq6AWhpRe", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MWK6m6yW5rwZLjzxx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:35"} {"_id": "grnvizXyS7waoRYtm", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BPbKfxdRMmfG2Wc3j", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 23:06:25"} {"_id": "FaweJktM74sEz8SWu", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "jWC2DbNTDAaug5jBH", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:44:54"} {"_id": "zpzcJDMrv9dGddTCw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lm6CNYnLD9hei9e2e", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:57:12"} {"_id": "jK68NwyzZwmfFuGMk", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "ahARJE7nsEEZEwBds", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:47"} {"_id": "HgBHZ9mLH5M4SZSHe", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tnot (Person in Student & Person in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DjxLZLQkEtRdXswir", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:31:48"} {"_id": "uNEiZqcb6gZiYfauo", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fZi5onQS3aysSqhme", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:40:02"} {"_id": "iRKdv5dmHdzFNwxDr", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = no (Class -> Teacher)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6FZeg23RBwz4TenCF", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:07:29"} {"_id": "NrGonLm6jmeA8ZCQD", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2LAqo2izCYi8QwGzb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:52:48"} {"_id": "uZ8wXKydDykfygXmW", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6Ayqdd75mvo7BQv8i", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:38:04"} {"_id": "NvGCNWq68jsFfN2Fi", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "xLhdHTQwQhsMgwjBt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:57"} {"_id": "aKwqmJe5oScJPnoL5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kXZCb7STDd32cXqqJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:20:30"} {"_id": "wD8eaT4dPXi27tzdo", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class |all s:Student|some g:Group |c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "moHCmCMKAq7KfC5bh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 15:11:59"} {"_id": "s4bxFzsC9mypMeiSv", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class| all s: Student | some (s.c.Groups)\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "iJytLboTiiwXqEiKn", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:39:13"} {"_id": "zYkDN4dpmWeMj7nkp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y4uuDjQYSZCi3RuGA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:55:21"} {"_id": "CbhZNjLYm8GD4rbYw", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutores + Tutores.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "augDymRJBdQt2AL2n", "msg": "The name \"Tutores\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:23:49"} {"_id": "qbBZTac5snfsLNNAY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) => (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "izyAeNhYtgDoBMot5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:13:18"} {"_id": "BoDshEgoGq6hAo3qf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * http:\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student | some Tutors.s & Groups.s.Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "xQF9m48KHaikz3CPt", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:49:18"} {"_id": "HaRzxMxQFq36x2n9f", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hnu8FBifABExiajpg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:27:10"} {"_id": "xhsJ7mmm4yR62fmDT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MbpufcCbCJaSxZoix", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:31:55"} {"_id": "5kLsnL5RggTEAyEbo", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zpeihE36HCN7D6vvn", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:27:45"} {"_id": "ZXmy6E8XqzMKWryH6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7KewLRdzoZvy8on3E", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:14:26"} {"_id": "XsobEj5NvejkB5dER", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (Class.Groups) and Class in (Teacher.Teaches) implies Student in (Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5R6Eha387fneqnSDX", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:17:37"} {"_id": "QbRRqtkd5AaPmQTWQ", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | c.s.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bp9s4djMyheXsotv2", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-7 19:45:39"} {"_id": "ofmvtRivi3FXrKLnc", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "hqp4WAiBd9o3gAz7z", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:06"} {"_id": "ZTkHvYRx8wgq3QAdT", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Person.(c.Groups) implies some t:Teacher | t.Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8e4P7PrYYJywXv6ou", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:38:05"} {"_id": "QGqZmGNomn2cQCZbA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "obt5PdAks5ZLnru4M", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 15:58:30"} {"_id": "MwDz4LXWZnaRXkN4w", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "GPiHy56d5sSxuJKST", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:19"} {"_id": "Zk6saY3paGRAFnawW", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and (t<:Teaches).c \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RErw6SZwqQgivNyzF", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:02:53"} {"_id": "j6ZNjc34ifpv5WD9Z", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3bbFC6st7kmnaiFmY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 13:51:01"} {"_id": "HS6Z6eDyH72iGHQ3e", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ENZgyisQ6N2kK6qih", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:13:59"} {"_id": "ppG78E626prhMGzna", "cmd_i": 1, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location {}\nsome sig Name {}\n\n\npred noSameOriginAndDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\n\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\nfun commonStops [x, y: BusLine]: set Stop { x != y => x.stop & y.stop}\nrun { all a, b BusLine | commonStops [a,b] }\n\npred test{ noSameOriginAndDestination and locationHasAtLeastOneStop } \n\n\n", "derivationOf": "5s7yq2ZRbzNbvSWtn", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 17:16:22"} {"_id": "v2PKLjcX2PhDg6JaE", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "wt2kDzghdYkGY3ine", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:16:46"} {"_id": "NRKNjfvAcPdNR6Qgo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one t : Teacher | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cf5oTghTcDR3S9u8y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:13:37"} {"_id": "GH2hkr6WZEFSSM8BL", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v7NHvpNwPKFdSXWbR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:03:20"} {"_id": "fPiJQcu8JnMpbEgQX", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeaches in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YvpmEryCHNCztnv4D", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:59:34"} {"_id": "GzKCSiwcGjDfDLy84", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "RSmLHFPACJmJbchvL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:45:09"} {"_id": "ZLDi2cp5Zy43PPDWA", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PKoCynhchcFHpegZf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:05:27"} {"_id": "zGBjzQiTxnzGE3kPF", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RZZjpg6mgXThDbwNS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:08:02"} {"_id": "xZK7Pbd2PALtj8DtB", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d4xxo3s3zPMY4wc3T", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:07:07"} {"_id": "E7etc2hSWKgJaGjbe", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yDTxe7vkcWNerQTTq", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class": {"x": 355.6640625, "y": 265.3333333333333}, "Group": {"x": 474.21875, "y": 132.66666666666666}, "Person": {"x": 237.109375, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-8 21:08:42"} {"_id": "w383gPc3nnYS43Cue", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\tall t:Teacher | some t.Tutors\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WkGhAYzfWZztzTy8A", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:25:00"} {"_id": "yw265Y5zPcynqo4Yc", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5FjAWRuLLTB9vs6Yz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:32:42"} {"_id": "XLDnsRwknzYTjTwc8", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher.Teaches:>c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2pqgofMpQEtXB9LHo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:55:58"} {"_id": "jfksayWsfhCjEgGbi", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (p.^Tutors) & Teacher\n}", "derivationOf": "Y6bfBS6WX2zwoKZ6r", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:07:27"} {"_id": "w6XsFSwSCnejyK5N8", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TRJRyxAiWZZ4Ag8Df", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:41:33"} {"_id": "6i9CAm9mKLPvpjR8N", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p:Person | one g: Group | p in Student implies p->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x7XA3SG2MxGky67oo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 17:27:46"} {"_id": "E3pD35aotFcFBxygX", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class p:Person| some p.(c.Groups) implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S9PrSo5Kyaiab2wBB", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:36:57"} {"_id": "qYAjp4kkunAB3KQ2y", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some c : Class | some t.c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Xsdcxot7osvxHpedr", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:03:57"} {"_id": "4rwqdmMGijBHo76Sr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | t->c in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\tall c : Class, s : Student, t : Teaches.c | some g : Group | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K2Wvm99TbgnyWivqF", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:58:23"} {"_id": "JxwFnHzhGCqwYRGAh", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeacher & ((Teacher.Teaches).~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qf9nWj694uyKGEbSs", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:16:36"} {"_id": "hRiBxS3tSgxNnDAwY", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t~Teaches . Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s : Student,c : class | some c->\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7MQag2GgwYPBTvjdh", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:53"} {"_id": "pTyzxYDFpxwDHse9e", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s:Person |some (^Tutors.(s & Teacher)) \n}", "derivationOf": "fxCEQoNvQXDAyELys", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:39:56"} {"_id": "hMeKFqxqHWbwpuGqu", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teachers = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JCxzaeeCFAWQsGYZk", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-19 17:59:20"} {"_id": "HHx8xbT3mfoeRJjmX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LhLzbotBLvHCnkknY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:40:05"} {"_id": "rNHc8uD4TRX9Fijkj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| one Teaches.c\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fmgqBWMCPqjSrShJk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:44:33"} {"_id": "FYd57DxFER5xHAndY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SjrKSAxQgQ9hyjzrG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:06:39"} {"_id": "J9LRXCEmahL32nnLb", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PkJJsZshdR3kFcWtF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:07:20"} {"_id": "T4FWbEKomcpnqDPBz", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some t.(Teaches.c)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SPS4xHxryqdLfJfcJ", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Teaches) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:00:44"} {"_id": "vLAMaQub3ZMhfZb9u", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HAa3EimESD3FGJCDJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 23:52:57"} {"_id": "WSxqcdNZFjWRjD8w8", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PL2hxEbc39MsjrsKD", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:09:42"} {"_id": "NtxAEvqpcTzWyKokJ", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (Teacher.^Tutors.p)\n}", "derivationOf": "DEisywWpu7ZCvfLu9", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is p (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:32:24"} {"_id": "Zqz6Qkepg2cianhMu", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\tall c : Class, s : Student, t : Teaches.c | some g : Group | \n \t\tc->s->g in Groups & s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MpGyTNox7gfxpwFMt", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:52:47"} {"_id": "bsDbxkmPmEYuKgDCD", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "TtKm42oLDKj3Nezob", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Person0": {"x": 523.9921875, "y": 132.66666666666666}, "Person1": {"x": 523.9921875, "y": 265.3333333333333}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-8 19:10:21"} {"_id": "gLpsttnj4wFbgc5Gu", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student /= p not in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kPHuScakWKiAB2QWo", "msg": "There are 1 possible tokens that can appear here:\nNAME", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 20:47:50"} {"_id": "ShnfzBQdPoJjjXMrs", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no (t.Teaches - Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jgyR7wKLWKmaKrfuS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:53:28"} {"_id": "jhhNkaaYESDpCmMsR", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher in Teaches.Class).(Teacher in Teaches.Class) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EjptoagvWDuAxcnsA", "msg": "This expression failed to be typechecked line 80, column 2, filename=/tmp/alloy_heredoc8008333175277384812.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:17"} {"_id": "8CTJybAxY6rTciEoQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Groups.Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3uGy3WeofurJHNcyg", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:38:12"} {"_id": "f38pWf2amSrgZEkya", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher in Person.Tutors and Student in Tutors.Person\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L5rNjwWhguWHCPg7G", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:25:00"} {"_id": "r2cYS7q9w45J7Z7PP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => no Groups.c\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AjhHTWeocr8s3NpMy", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:08:24"} {"_id": "GjujKXhgG5845LQKL", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RmxeTrs7wGpxzHz28", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:06:04"} {"_id": "m9XM9DArMYPJork6x", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and no Student.Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k8qqe88ZQyPDZXjSF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:01:13"} {"_id": "tEP28LExvdpXv2u9j", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tno ((Person & Student) & Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kS3Q2Cx6zy79KXB38", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:32:24"} {"_id": "5xC5nGeD2S6zDjCCo", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s in Teaches.c\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e22TcGeyxYF3z73zW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:27:39"} {"_id": "coqBHjXGnraYhy2xs", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent or Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4ekph4kAgbS32ZuRX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:31:07"} {"_id": "ahARJE7nsEEZEwBds", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "w8QcLt8EWjrRDxQJj", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:26:41"} {"_id": "EjgmQTFAmXgDXxTLN", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X5oGKkkKLhmjH67Mq", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:14:01"} {"_id": "nHTrh2apPuE7BuCcm", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tno (Person & Student) and no (Person & Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8zN6whtXSqqabqdQC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:33:44"} {"_id": "h4vCDbDGBSoiBjbEK", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9G5v8C8SFmPy9JPue", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:21:41"} {"_id": "dPuhrza3ipbNKXfw6", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Class\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bv8whghHMRugs58co", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 18:18:39"} {"_id": "vkWAoRBsowofCuXX8", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fJtLarrCyAcWmeDf7", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 444, "y": 159.2}, "Class1": {"x": 222, "y": 238.79999999999998}, "Class2": {"x": 0, "y": 0}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 444, "y": 238.79999999999998}, "Person1": {"x": 444, "y": 79.6}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-22 22:27:04"} {"_id": "bp2BNTszbpgGwv2SR", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s7NLJz4LEek99H9Fz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 17:13:38"} {"_id": "QSsS75yEEWMrZcD9K", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t \n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "44iaXWsfE9Zm3M4gH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:22:23"} {"_id": "tzwNgb9DHjzwmTSzs", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aWq8BEniNyfhLSwWC", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:43:10"} {"_id": "xWgKzcLSELsRprGb8", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher, c, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n\npred inv14 {\n \n}\n\n\npred inv15 {\n\tall p : Person | some t : Teacher | p->t in Tutors or p->t in Tutors.Tutors or p->t in Tutors.Tutors.Tutors\n}", "derivationOf": "Pnhp4po5S3FCtewaQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:24:12"} {"_id": "KExecy2XWDrNRcduk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7yu9ewuroRejokB82", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:03:26"} {"_id": "PyEwrnFH2PuMS85W9", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher & (Teacher <: Teaches.c) => no (c->Student->Group & Groups)\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "shgmnCvcb2W5Nhn5Y", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 23:13:12"} {"_id": "SPxa4MdEb8jiPaLY9", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ENA8ii5t4qrY5eKbr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:32:36"} {"_id": "rFeLpZKiwWEy8oqYt", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s:Student, c:Class, t:Teacher | some g:Group | c->s->g in Groups and t->c in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x8o5CMTWrC6JYdpuq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:27:45"} {"_id": "oqy6zpKFTCrnjSC6Q", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2KxqxWZaZBX53xTKr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:01"} {"_id": "rS5jyRbGK67xgib3D", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c & Teacher\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7wFXdTf2ZLe2qsfvC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 14:58:12"} {"_id": "rDagBwkb9iR94KSX5", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (Teacher.Teaches).Teaches in ident\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JtFEzfrjcr7nPG6ZG", "msg": "The name \"ident\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:30:46"} {"_id": "B2Zdaed87RaDjAwjS", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "BbhMYSzzipkdrAkDW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:20:14"} {"_id": "WpvbwsKMDcbdNKaZX", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sqDS4cRzZPqSBxXh2", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:49:42"} {"_id": "JtFEzfrjcr7nPG6ZG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n lone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5vep5YSsJdY3YkYBG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:29:44"} {"_id": "qbsWTSaKJZMrDmdp7", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttczsueMxLaxSp2nX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:33:13"} {"_id": "9yZqN26RhMqiGGX7S", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | some c.Student.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tdqCw3TdKPMYqNifC", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:44:38"} {"_id": "acjb9eCYFHcD5oapZ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "nRGfqMt9WSqWQijzd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:20"} {"_id": "3HuSsyeCzYuYjrHr3", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QMbCrK9yJvx6m5Kj5", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:30:11"} {"_id": "9iXK7xo3EoCKi8HmA", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "stGeHRihA5hN75JYi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:12:31"} {"_id": "qf9nWj694uyKGEbSs", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher.Teaches).~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tv3CPHJeS3YWYqzQ7", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:14:01"} {"_id": "7X44J3ABgqKKLpiEE", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t:Teacher | lone t.Teaches:>c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uCuhzw29eipEyvGSK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:47:15"} {"_id": "6ZMBtGxwSPhig9fcE", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c and Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vSdSGHETxyrmuLK3s", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:14:00"} {"_id": "6WQmbSnMWx4fxGk2H", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-2-24 15:26:44"} {"_id": "hmaB9qPHYDLtBSP4w", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | t->s in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yw265Y5zPcynqo4Yc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:35:21"} {"_id": "iXbKhShiNKMxgKoti", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n some Teacher <: Class \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kh4avCcd8dPm8Pc7T", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:19:34"} {"_id": "xBNZSzF4XvtbuHvNY", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bPgQzeRH5xcXq4Yue", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:32:54"} {"_id": "iSDYMLqjpMTHymcKE", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | all t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3WEpDcovxXyYZykcd", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:09:39"} {"_id": "KNjvgKW8TvNewbbrp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \tall s :Person, c:Class | (some g:Group | c->s->g in Groups) implies (all t:Person| t->c in Teaches implies t->s in Tutors)\n\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "29NFizPpHo5y4SxmZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 13:50:24"} {"_id": "dLLQWhk3ohQ4D6f85", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | some p2.(c.Groups) and c in p1.Teaches implies p2 in p1.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3yJNgJCZtAe7ARHaj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:56:34"} {"_id": "rZCczgKiYCXpfXrek", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies Teacher->c not none\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "enGNAWZsbaJMgzEHx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:12:38"} {"_id": "kST5cF4umMRtRqQG8", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #(t.Teaches) > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Tutors and (all p : Person.Tutors | p in Student and p not in Teacher)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dGKMbQthyoXDNz9BA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 18:06:23"} {"_id": "NxgjGCeAQkRWDhQNx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | some ((Person - c.Groups.Group) + (Teacher & Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MrWtWGtqmNTPQGTqT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:50:43"} {"_id": "JF7M4R8ockTacvkjv", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n (Teacher<:~Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "udNfGzBpSKMwAkwQN", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:47:17"} {"_id": "3xrqEyR8WSyZs8Rev", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups | c in Teacher.Teaches \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cogcxWPGb6rbKsTpb", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:08:11"} {"_id": "Z8iub882zzCnzxD38", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c not in Teacher.Teaches => none c.Groups\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gTwzLC2uH89yNfmeL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:01:04"} {"_id": "FJBAuckH3vuXsgDrK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iH72c8JDuiAedoJwh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:30:09"} {"_id": "26GyShzWthC85Gysk", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, t : Teacher | t->c in Teaches => (all s : Student | some g : Group | c->s->g in Groups => s in t.Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "LGerGdPEZE4QCjpDc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:30:32"} {"_id": "TktdG7TnGxSrZasw3", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t :Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Muav3BSMQJBpjCmzc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:35:08"} {"_id": "izyAeNhYtgDoBMot5", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) => #(Teaches.c & Teacher) > 0 \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p7Eeg7eCoDW6sFdz3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:12:41"} {"_id": "ep3cqiLq7zcpLPzcz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t->Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4jnRjWnZy2NetyrTT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:21:47"} {"_id": "YvpmEryCHNCztnv4D", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vCJvzpNDPgoWbg5nY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:58:33"} {"_id": "hxBP9n8pXshMqCoeL", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | (t->c + t->c1) in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NRfLgB37jegebag4q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:25:59"} {"_id": "NmMhueiFke3qEnHF9", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tno (Teaches . Class)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SiXEWTpnJGZHpn9XE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:02:45"} {"_id": "YZmkJFSk5o8sfNw3o", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eg754gy7w837XCh9k", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:44:46"} {"_id": "GPiHy56d5sSxuJKST", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "LNwrHbhewzaGBiTNs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:18"} {"_id": "7LLXuR6mcZMsaHvqt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - Student - Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fwiae39sZK5FJKxum", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:34:17"} {"_id": "pBanQKQgZctHji2pp", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oqKkqLSdcSinHBjnF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 20:31:17"} {"_id": "Hs2m9XStdHRKboNWQ", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p : Person | p.Teaches\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jCqDL4evvEyCEDjs7", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 09:49:55"} {"_id": "jRDtDfzbYLeKyWHmk", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | Teaches . c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pSaWo8S3pqWNetdg3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:49:56"} {"_id": "tjDFvGpuy6wkRj6j7", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KDx2aupz9Q34aitWG", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:20:56"} {"_id": "qTLL2PqbKQ3oYo84n", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | some c.(p2.Groups) and c in p1.Teaches implies p2 in p1.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BymHiSon7nCyQqQN9", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:55:39"} {"_id": "RP4FTDAkGuGRu5dXb", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "RH44uvktJ4sF86B2B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:30:55"} {"_id": "v8vBvuikJBBH23q3E", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeaches.((Groups.Group).Person) in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "44xkud245NjoAGGuJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:01:39"} {"_id": "4Xzyzmrzmopmqzsfb", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z5gaTXckjJfqugNyB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:22:18"} {"_id": "Wr5BM2tro9qtYgmkH", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ky6oChxW9QPLZBu5X", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:59:11"} {"_id": "cM7Xec8DxFFDt7Tus", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some (c.Groups.s)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PLgFGkBCeRby8t49j", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:09:29"} {"_id": "KSPAiuBoYRmAcCNkS", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ((p.^Tutors) + (^Tutors.p)) & Teacher\n}", "derivationOf": "dYtkcmBa2xX726rLM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:08:35"} {"_id": "ozbCqLSRnonu4MstB", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in no (Teacher & Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L5TkFMsxdfuqgppXG", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:53:08"} {"_id": "Km4DxiD3jFaH5iNSC", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t~Teaches.Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s : Student,c : class | some c->\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q3SnHZ2QePrstG3xX", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:30:57"} {"_id": "hebSLBtHLEcMPj4K8", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "mxWGvWuS8uzv7vwkw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 10:35:09"} {"_id": "iMQ3qs3Teyis9qoCd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher = Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "avnAW4sDuQKDaZkFm", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:24"} {"_id": "gr7afiy6NdmYWiQnZ", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c and Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c.Class | lone t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tyjPRok6h5DeMxoNz", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 14:12:38"} {"_id": "6jZPPutbZBbYZDLwm", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~Teaches.Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XdkJ8xMyE525FZ8XR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:21:29"} {"_id": "synqvKAzK4SjtoT3p", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "68GwCuhYd7qsnAutD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:16:24"} {"_id": "K6cNqrasmkL8kgdWj", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | c in one Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xvd6KSaLXs5YFtfWk", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:28:17"} {"_id": "4K6YsCQ9vR75B2C8j", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some t.Tutors\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sFEvostcDNkArnF2L", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 15:42:06"} {"_id": "ugb363o9aZJXgdEX4", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a7KXd72L9ny3K5Xik", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:58:27"} {"_id": "vS5hY6SX42ReHxR2L", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7SxNB2zgoZ5aKb7Pc", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:10:39"} {"_id": "qitgQZPTcvMxj8yXP", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Teacher.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AdSvszCBCNCTAzpHq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:34:05"} {"_id": "mG7LaM5wZcmL4mGG5", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tp in Person implies (p in Student or p in Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FoJ2dLRdbySLHFHNR", "msg": "The name \"p\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:50:47"} {"_id": "kXZCb7STDd32cXqqJ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XCsFbRoj4LbRESekB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:19:16"} {"_id": "38yipSW9HYXJGSPSy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (Class.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ubojkrhQ64gsGcmE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:59:39"} {"_id": "deidxaA4rEPCBJhfY", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Teacher+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher.Class in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "s78GPpvioRbLREYJN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:27:35"} {"_id": "MvGZz7s3tdRmuvQFH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall s:Student| some g:Group | (Groups.(s->g) in Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "NJjRYHcLiceycS4eE", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:43:20"} {"_id": "SuhkyPiLnkDvbByoA", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.*Tutors.p) in Teacher \n}", "derivationOf": "sGx4sacHRqHrmXZJf", "msg": "This cannot be a legal relational join where\nleft hand side is p . * (this/Person <: Tutors) (type = {univ})\nright hand side is p (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:17:20"} {"_id": "7oHPndphvBWZEZ9X5", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Class.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qSFBGxCRD6SvmpHnA", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:23:22"} {"_id": "tff8QRLpADy4Dd8Nh", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n all c: Class | some c.Groups implies some Teacher.Teaches\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some Groups in t.Teaches \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p : Person | some p.Tutors implies p in Teacher and p.Tutors in Student \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "q5L2y4ojgxgTsrWdf", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:47:52"} {"_id": "SmNT7vhjXPJDPLRyb", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kuExu5FHGTkbCKvhz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:21:28"} {"_id": "7KPY92RQHdE3GLap6", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups) in (Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fMth8vRWKpGhML5La", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:13:03"} {"_id": "bqM3XJ2T5bdHaEGkD", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Teacher = Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k7ZTB2GGEjcDDoLh5", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:12:03"} {"_id": "xD8XHt2HQEHPGDCpg", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tPerson in Tutors.Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w3ZEkkRbr3r8bhGPZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:11:43"} {"_id": "LNwrHbhewzaGBiTNs", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "3theycWReBPW35H2x", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:15"} {"_id": "GnyCaAQZbNSHEDr9q", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "7uv7fHwrH8uoP2aT5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:39:42"} {"_id": "sbWdzsouvykC7wRAX", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Teacher and Tutors.Person in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f38pWf2amSrgZEkya", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:25:48"} {"_id": "rEkArkfS2PiHnKtTQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wc4vF8H3x3e3sewQJ", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 20:58:30"} {"_id": "nzLDJmP3gnG2Geiz8", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6CdG4YG42twvxbSra", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 19:23:04"} {"_id": "6z9Wgbp2mXM7r5uqW", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->g->s in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4HCx9iQjjtocy2LGt", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Group->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:02:03"} {"_id": "7HaMnzxJjhpCFQCsS", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tPerson -> lone Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HGYtaGQt8xBxLLvGE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 17:41:46"} {"_id": "DSsnAMikL46pYu8Pi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eLQzqtQaBTA2f4crn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:53:34"} {"_id": "4vCcNEZPwE4Tfc2Rv", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K7vnewqcYE7Fv9rB3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:54:10"} {"_id": "xLXhfJiYgef7Dgwb9", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FYd57DxFER5xHAndY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:06:46"} {"_id": "46iBZLCrXCP9dQy49", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TaXcSHogNfNPb4hry", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 19:55:26"} {"_id": "YscgKPT7g7wPakLKz", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n\npred inv5 {\n \n some Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "Y3Et5goWstptA5eeq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:59:57"} {"_id": "oaaqGx8bmZQLt4Ydh", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | no p = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Y8YtxZcf8p6waxNLH", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 23:54:16"} {"_id": "xEAS4Pf49XdNke4Zo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | no Person.(c.Groups) or some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "afBS7xzDTDuiur3y6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:42:09"} {"_id": "t7gePHFnthk8poXB5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qYAjp4kkunAB3KQ2y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:04:07"} {"_id": "cjthZsDhFf6EbZAM8", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KeEPL6KkCv8qFpEpS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:31:33"} {"_id": "RDPTLmtxq9PSAQQuW", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tall t:Teacher { t.Teaches}\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A8swM6iXGkbjBxgij", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 03:46:36"} {"_id": "PAz9GeoJQwNS8L36B", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { no Teacher\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T7SZGDzXBPfagdgGS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:25:19"} {"_id": "2p4eHPr7ZMRaC5R8i", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2JQJyH68S64wHk7yB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:53:40"} {"_id": "bADi65yKmnzqHXfZZ", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | t->Group in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 19:36:05"} {"_id": "A2oQQSYkLA3LLFH5h", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "BygpMsh4oMJCC9mj6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 13:23:41"} {"_id": "PD5a4EFYvxTqNm9Se", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall x:Class | some Teaches.x\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SPxa4MdEb8jiPaLY9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:33:19"} {"_id": "kWrfvYpAy4tGjzBE6", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c in Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XR9AgYtEe77ymrw7p", "msg": "This expression failed to be typechecked line 78, column 17, filename=/tmp/alloy_heredoc12579100629840684789.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 14:47:55"} {"_id": "Fd8aTxfZap4HebWf6", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "e2XCxhLpLZoLHhv4s", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:57:57"} {"_id": "dq6NffXHrMdZwxMub", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AGeyJex3LEgHMkRyd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:41:25"} {"_id": "bzXWGMQaab2AyP59v", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | lone in Student or lone in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ywcennTMaYux7iNDL", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:00:02"} {"_id": "uk7cFwwEWLDgpaS5B", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ziA3MrqhQwtJrhaXX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 16:39:30"} {"_id": "wt2kDzghdYkGY3ine", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | lone (p.(^Tutors)->Teacher)\n}", "derivationOf": "fmpRCHYo6LjuymR95", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:16:33"} {"_id": "j7CWzw6QW2METkvsJ", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | (x->y):c.Groups implies x in Student \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "gWnfQdvDrZP8wvKLX", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:45:46"} {"_id": "fyC36XxZsbedMHEHY", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tall g : Class.Groups | some g.Person in Teacher \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZqeG6i8n2mXaonRur", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 09:55:41"} {"_id": "BuJNQd8uHxeQy9tSf", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | all c: Class | c.Group implies t in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oAiueFn35KJb5jgbu", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:28:04"} {"_id": "mm5kSeppEkS8Z3NBb", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some t.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jYk7H6gP9kvx22zev", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 12:31:16"} {"_id": "kH68Mp6xTYf2LRbHg", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all t:Teacher->(<:s.Group) in Teaches implies t->s in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "fAm78uBpexgNbX8bq", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:01:33"} {"_id": "uD9vnzY5vL3bNe5t6", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dtbL9hAchhnKnpeKp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:29:12"} {"_id": "FKvkhZY4DqMzWav9d", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | lone Student or lone Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bzXWGMQaab2AyP59v", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:00:14"} {"_id": "tDYwB26hHfPLSZtYz", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher - (Student - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "soFjbCHCap92s3aN5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:51:47"} {"_id": "iH72c8JDuiAedoJwh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5xcdDSeDeiZZ5RouR", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:28:59"} {"_id": "6uhJt2ZqcRRSsGixc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SmNT7vhjXPJDPLRyb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:21:37"} {"_id": "5G9L372mgJa2K8GX5", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher . (Teacher <: Teaches) = Person\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aFRR54nfnn4Jpigmf", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:36:55"} {"_id": "oSZcMTZCvhtF43pZ3", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | ( Person - c.Groups.Group) + (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TJXPvBgM5AHwvorzS", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:48:50"} {"_id": "zJCzeo6cgvaPFREWB", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FMZjhB3MS9tMPJHxW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:39:40"} {"_id": "w8haoiKJQA8XmSnXm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YKnvCCiPc6bKsjEj7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:10"} {"_id": "kRAHwJckymCSPy4tc", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oXZq8Km6Sv4CWGg3y", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:18:54"} {"_id": "3NeqxsKCyttYQNSgG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tsome Teacher & Teaches.((Groups.Group).Person)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xnumraQoixL9ZAXGY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 15:59:14"} {"_id": "7hecJ6BjstkpF9bPy", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tPerson.Teaches\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wbvv5ZXGXLn8MmaNp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:16:44"} {"_id": "bduFwNko4uG2nbfDY", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class | lone Student.(c.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "Jvj23e5iMr9uPFoGY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:30:40"} {"_id": "vSkHxLaESxxzcFDPT", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "8yRmQCujptpw3ruER", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:14:30"} {"_id": "W24M87tpjTfCvFsby", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | no (t <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\tall c : Class, s : Student, t : Teaches.c | some g : Group | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8sJfyHCShTjvowqNG", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:59:11"} {"_id": "yEi2xTySCfM9aptC6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.~Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gheZm4EMJv24eBwHP", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 17:34:54"} {"_id": "jJBxcvWZGdv4hkeAK", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| some (Teaches.c) and some c.Groups \n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "NS6mexTqNoLh53PXd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:25:22"} {"_id": "K5j5CiNhkfNjinGK9", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "CnPAmvFtTp4wGhXBD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:15:08"} {"_id": "ni4eLHZ3dGFBAgeQC", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8twsQH4udK5q7Fh9m", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:35:31"} {"_id": "WKScfnRmoedAEQqAn", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class | all s:Student | some (c->s->Group in Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | (some c.Groups) implies (some Person.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vTxm8ohcbTmm2pnRt", "msg": "This expression failed to be typechecked line 91, column 34, filename=/tmp/alloy_heredoc5843378174487489378.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:40:57"} {"_id": "nESs879r9T3ibnviJ", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (Teacher in p.^Tutors)\n}", "derivationOf": "P337bcuKzHR77yp5o", "msg": "This expression failed to be typechecked line 117, column 17, filename=/tmp/alloy_heredoc959142236930388210.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:51:18"} {"_id": "cMokxvBBsNWrJste6", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "cy9XtCLM3Leig4g3d", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:24"} {"_id": "PQS7s4EnhWF8Mumxd", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Student+Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SRdZP69zxxtry8vxs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 02:30:25"} {"_id": "Eqhn4EQKpgq9Bp6qZ", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n (Person & Teacher) or (Person &Student )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R8QEkPhKJf5T9vCzf", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:48:55"} {"_id": "3FgvyZkZfryvrDEbj", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher<:Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "q9ZFysGHcNdaNNpym", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:03:48"} {"_id": "7jSEgieCA8m9Js25p", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fNsyKj9WLHhdsWiRW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:18:50"} {"_id": "a6ZErzc3gu6xMFtwr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all p: Person | some g: Group | all c: Class | p not in Student implies c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RMTFcEmz7RXezFpiS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:26:59"} {"_id": "ig4cm3PQ2BadEgex3", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Teacher & Student.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EnKnJYjYCJQFqFMyJ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:33:32"} {"_id": "SaRWGt3MpiMsX5wzF", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and c.(t.Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zXFDAkK5CjcPWi7sa", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is t . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:00:03"} {"_id": "2dqpXWmzYwYNqdBGf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CzEBcC9BTBvWX3L3J", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:06:32"} {"_id": "jM8s5nj4vx47PHCRr", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:29:09"} {"_id": "qC6k69uZMfETgxKcM", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tsome p :Person,g:Group | some Groups.(p->g) implies p in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AvqNwQwP7HqHwddLB", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:41:09"} {"_id": "d4xxo3s3zPMY4wc3T", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n People = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"People\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:07:01"} {"_id": "aMw6wxJSpispBGWsw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j6ZNjc34ifpv5WD9Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 13:51:37"} {"_id": "GEnt9E5qNrcZ6Ynda", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KkqDEbzG2NYL8D2K9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 11:54:37"} {"_id": "9W4MDaTCeKFpTXmw4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZQNeyrhFYjBfuqppr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:09:08"} {"_id": "J8T8jF2LkzmRy2Gv6", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "478FZB4Pps5bd3jEh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:01:56"} {"_id": "LYtP8pRovfNGGyJfz", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "svpGTb8YnA8YeKrb4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:19:07"} {"_id": "gsTGzp9MqespnAxrr", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person | p in Teacher && p.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BMdQdMqXmm7NSDtHg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:45:26"} {"_id": "8qnDWyFMKWSQSDgRF", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WNuZhhq7t9wAKFReJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:34:18"} {"_id": "7s2w5wxZbrRwf4dQB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | one t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7AHisJms22RsASrtG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:57:40"} {"_id": "QtKo6C9pt4Gj2ZaKn", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-12-5 17:34:11"} {"_id": "G6CwPiu8WiREYuwdm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cz6y6zPWYZsYBXHou", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:05:04"} {"_id": "2etbh24kqPg3qh5eP", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jNFSzHiDDFFgYwaS6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:06:32"} {"_id": "msC2FWsZGxXJmb9oA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | one c.(s.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rzYauwR5uZcLRy6jJ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 18:47:45"} {"_id": "TRrQ9zk2BvjJtJmDY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "MwDz4LXWZnaRXkN4w", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:21"} {"_id": "rYYuRxedWSa5yuLS6", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome Teacher.^Tutors \n}", "derivationOf": "uc4BHbbdStmaP92w2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:14:29"} {"_id": "RZykYbchuipsWy5FQ", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c in Person->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F6XGirGZuditnTWhf", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:14:16"} {"_id": "JZXgtSPwCGB8N8QxG", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "bMDi9HqJRHAKZkG59", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:27:17"} {"_id": "K2N2zRwhpYEWwP4MQ", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tforall p:Person -> p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bjifNHDhTkmfpi4qj", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 15:19:13"} {"_id": "PtNEo7FGZFtX8KjMT", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class, s : Student | some (c -> s).Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6w7Z3hk5jfqZ6JcoE", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:59:37"} {"_id": "iu69pTkoaraqfDA6T", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches in Class and some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9HgJqPa7Y3QjE4C3w", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:34:58"} {"_id": "EGp8GySyFfzMsecrq", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #(t.Teaches) > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n }\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FLmN6ub8Qxnq4gxuj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 18:01:22"} {"_id": "jMCXAhvt68ns62dGe", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X8jPpzyovoemXvBEx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:26:56"} {"_id": "kp4N6ZG95yuwzDBcD", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Person.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pFS9RQRRQQWfAx5JF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:40:26"} {"_id": "hPMWhpppqgmTNvk7E", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Person.(c.Groups) -> Teaches.c) in (Group -> Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uprL3fXcJWYXQvmk9", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:36:56"} {"_id": "yQErHEhebMxpABzNd", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "umRZ3K5mx6ccWmdRF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:02:31"} {"_id": "Go8MhoqWD4Rrr7KyT", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { \n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tE533avcjwvxJCD5v", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 16:34:34"} {"_id": "tdqCw3TdKPMYqNifC", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { some Class + Student.Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3xYZKuuRJuB5fcyMX", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:43:06"} {"_id": "5mGSEW6EWn22R6XTy", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p not in Student && p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v2pqbzuqwgESvhkvg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:02:04"} {"_id": "PGzFfSfQuAqYs4mDq", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher | some(Groups.t)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "yHAW343jeTAdstDaw", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:05:46"} {"_id": "5QbARpcZmJeh7jhEv", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xa2wEMt7oGT5bkBCZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:37:44"} {"_id": "DXNbxPyxSH3QbY9d3", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZPJcguiooCmb4Bnqp", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class": {"x": 411.6640625, "y": 265.3333333333333}, "Group": {"x": 548.8854166666666, "y": 132.66666666666666}, "Person": {"x": 274.44270833333337, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 10:47:44"} {"_id": "PXfM2KB5zxDwRc2tF", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z8XdmNcTPtE7omBEx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:05:11"} {"_id": "ZPJcguiooCmb4Bnqp", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some c.s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ta98EY54FoLstcmNS", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:40:01"} {"_id": "SPdR8rC6eiTmMvRoa", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uhP3vQzyhDFS2CZvt", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:07:20"} {"_id": "a7jSTDexWorbf9K8y", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 13:09:30"} {"_id": "Q5t5tMn9m2c8TPPWh", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher = Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WPoxuvwDwyoWjZq8E", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:33:41"} {"_id": "waNcSLurop3jAKwbo", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eMbyi8WTNCBJuTAAH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:46"} {"_id": "JMCGsgMX6jCQPPisP", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.Tutors & Student, \n Tutors.Person & Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sj7wyuiZcYwg4cydi", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:31:59"} {"_id": "qkXFsNsJDYxfa8DuX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mQYk6JHmbYncGjN8c", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:24:25"} {"_id": "XqSuoZYXqy9HawjbE", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n no (Student + Teacher)\n}\n\n\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "QidfBR6fLooGtzHdt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:58:11"} {"_id": "z3fdqEtLaEHSx259m", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nX9HAwoFxDujgLTug", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:21:59"} {"_id": "G9QJcenmwqJpfNQ7w", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c -> t not in none\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S3yk9JQAgJ4Z75mj4", "msg": "!in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:43:15"} {"_id": "PhtZ4x4NexbqDqTac", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Tutors.p implies (^Tutors.p:>Teacher)\n}", "derivationOf": "KLp6Z9zsDsijjr9xE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:30:37"} {"_id": "mYsFSvSWGw5XK3SRr", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t->c in Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DTHaEGNy9EFMfYKeP", "msg": "This expression failed to be typechecked line 96, column 31, filename=/tmp/alloy_heredoc9359792086489562870.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 12:01:18"} {"_id": "DvCHZM2tEDYsggLwQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LRhtJ8vo3e9ssg2Hk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:31"} {"_id": "CJu9PAjEyBiXeEu44", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher:>Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aKdAwbDnDvczEK8nj", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 20:56:50"} {"_id": "fDkvAPyj7RsxMhcTo", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nD\u00favidas\ninv3\ninv4\n\n\n", "derivationOf": "BakvF98aDQBSj7pzf", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:46:16"} {"_id": "n4uJrysoC96LSqCvT", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tMnLkZvgPMmooppit", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:59:30"} {"_id": "MWK6m6yW5rwZLjzxx", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3k62NLxyEQXrXsucM", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:10:14"} {"_id": "cWMayRmHA7ewhJpr9", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all c : Class , t : Teacher | some t.Teaches.c\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zmxXZhy5S6zZSdi2E", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:05:43"} {"_id": "Jzgdqu4NE7fGRnJHB", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher, g: Group | c->t->g in Groups\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y5jYe9cMdJsrBwX4H", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:50:50"} {"_id": "TWrNymiRGYhKQYpqi", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kKsYgi8mt5ahXZhbv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-18 11:28:36"} {"_id": "fBEerTfmerFEDDXnL", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "bFzYB4BZ6ZkDywun6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:53:22"} {"_id": "73EcjBqLT2vHuGRtc", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AFQTvT4r5kzwAoazx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:21:12"} {"_id": "FWizeMCxzKDAcXZdq", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "B6ZGSnRGH3Sj8Y5ov", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:18"} {"_id": "52yEcjcdXuS2baHPC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher or Person in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pb5R9tYFvAjPc3Nwf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 12:17:22"} {"_id": "Lez8kNpPHmWm2JyjW", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = (Person.Teaches) -> Group.~((Person.Teaches).Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SSmwN9gmMHuaF9c2x", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person->this/Person}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:52:31"} {"_id": "fr6ekT5irfeewZrdM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZNBSe8tc4BAWNRF8Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:33:03"} {"_id": "aFRR54nfnn4Jpigmf", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4QmCPJAT69tciJk4P", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:36:16"} {"_id": "ig55qwJtEttJhEwXr", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some mc.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2p4eHPr7ZMRaC5R8i", "msg": "The name \"mc\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:56:24"} {"_id": "8zN6whtXSqqabqdQC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tno (Person & Student & Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tEP28LExvdpXv2u9j", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:32:35"} {"_id": "FuMRgSi7MjWaZjMvu", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (Teacher & ^Teaches.p)\n}", "derivationOf": "R6F3iwFDipSPhLgWC", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:22:52"} {"_id": "3r8KW2KtJ4xLaPPfp", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qvHEntBKXCqXMBFcy", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:14:02"} {"_id": "ttgGmocWvLdPFDuNM", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n Class not in Teacher.Teaches => Class.Groups = none \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3aoYuzd7Lmcv3ZgMC", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Group}\nRight type = {none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:17:25"} {"_id": "HJJFhqoZriCCoJvx4", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cR7xygwpxBouL8QH6", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 15:00:55"} {"_id": "pMb46cmvoJzETax5B", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Student - c.Groups.Group) + Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7cgZ8nQa2Rj2hZu4E", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:54:11"} {"_id": "57wdkcPFDwkMsrCuX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all c : Class | some Teaches.c\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SFnfCuXsRQeeWydKf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:11:10"} {"_id": "amKu3Y8pYwKxhacnZ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bahQCj7937ur9NMRv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:16:55"} {"_id": "WxDoSEnKLnq6rhQ7i", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | some Teacher.(c.Groups) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yL4oy9AWgtGLptEZS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:40:17"} {"_id": "FThHWnaGztsZZnjFf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) implies (Tutors.s in ( Teacher & Teaches.c)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zw8waeKnDhdoKYMxK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:25:54"} {"_id": "kRXiNXL2vwNizHrSA", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cdZcPaLqQpWwr9mBM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:53:18"} {"_id": "83DDntQF2BYLAvBAq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some t.(Teaches.c) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3oGufb9w3riAfijXQ", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Teaches) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:55:34"} {"_id": "R5GJFFSnRSXpTbAMS", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | Groups[c,Teacher]\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "trXoXzATnEdZ3FLFa", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:44:39"} {"_id": "SxT2zTq6xvCn6e5Cm", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "GLsjZ8TjT5ZecJbun", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:05:46"} {"_id": "tEcYH5PN6HavEz4q5", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s:Person | some ((^Tutors.s) & Teacher) \n}", "derivationOf": "9mJDFSssZaNCF9Bi7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:50:31"} {"_id": "GvjtskRLaAwSckmvS", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \t~(Teacher.Teaches).(Teacher.Teaches) in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AMJgriju3Fn8Z8Mza", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:48:48"} {"_id": "sJNK8CdpHGeSAHNSi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n all t : Teacher | lone t.Teaches\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "AoRopg3JRThhx9zNS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 19:12:39"} {"_id": "XCsFbRoj4LbRESekB", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Peron = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"Peron\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:19:12"} {"_id": "aYxnzcgxNuiLRptzF", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class | t->c in Teaches and some c->Person->Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ruj4qogSifwLytSY4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:12:26"} {"_id": "uc4BHbbdStmaP92w2", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome Person->Teacher & ^~Tutors \n}", "derivationOf": "idHvpBLmTyWxPLpxy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:13:29"} {"_id": "nh3vGoKHnP4mFLASR", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wHjMb24Ktr65hPsGY", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:49:11"} {"_id": "QBA5HZqLxPmu3eTR6", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c: Class | Teaches.c->c.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p: Person | some Teacher & ^Tutors.p\n}", "derivationOf": "CThx3CgK752uDsPhr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 23:10:13"} {"_id": "nDuGBWTmu8ghKNLrf", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (Teacher & ^Teacher.p)\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:37:12"} {"_id": "7t39FeSJtdasrsfpo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | t->c not in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w2wp28JCfvnNfXi98", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 12:02:11"} {"_id": "hmGHEZmMT2v4439F4", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person, c:Class| (some g :Group |c->s->g in Groups) implies (all t:Person| t->c in Teaches implies t->s in Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "s3GQSdAWiAt5JYDpo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:21:33"} {"_id": "sB52w23G4J5FWqrbr", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p : Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno p : Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mDZfmfTE7XvCxor4Z", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-11 11:32:32"} {"_id": "9qGHKpSnRPraTcA2K", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | (p in Student and p not in Teacher) or (p in Teacher and p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aiHhhk8pLS3iYNThL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 16:56:51"} {"_id": "mbLQcFHk8YEtoio6C", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t~(Teacher.Teaches) = Teacher\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p72JtqBeGvuZw2aCa", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 14:01:58"} {"_id": "6wdj9bmEk7mZHRcwR", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ngnY42tYz62wZLMtu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 15:17:38"} {"_id": "QnCFoQdRtJLPpjYBa", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tno (Teaches . Class)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2A6gp6SzGFXJad3WC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:11:57"} {"_id": "QR37HFyE5ek8MtcAx", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | (some c.Groups iff some t:Teacher| c in t.Teaches)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "quEEfotuR4rScEYvT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 01:47:29"} {"_id": "2CvGxYfRKkE3hX7av", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t : Teacher | t in (^Teaches).Teacher\n}", "derivationOf": "7TePdKRy5m2Zk6hSj", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:15:14"} {"_id": "XqEbxiMv9KhqH5dPv", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | Groups.(s->g) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y4SR4YSGFTbLeegP8", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:21:55"} {"_id": "qLzXy5agkWWrXwkGR", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { all p:Person, c: Class | some p.(c.Groups) implies one p.Teaches&Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ik7xQbRYbqZsKcwXx", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 19:13:32"} {"_id": "kjtXvK9gJhj2X2tKq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : class | some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches implies p1 -> p2 in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "psqunqoA8x6hph8eG", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 19:26:36"} {"_id": "GyK5Gd6ydmcY39Trk", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:53:57"} {"_id": "LomTZu38X6SK8GnG6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { lone c:Class | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class { lone t:Teacher | t in c.~Teaches}\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class { all s:Student | some g:Group | g in c.Groups.s}\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JkeSHZDN2uAurZCDN", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 04:23:15"} {"_id": "izdLpse6fgqxQmvrp", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | no Student->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GQXy8k4CpSJRuEwij", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:28:38"} {"_id": "YyjbhKpywWW6czGkp", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | one Groups.Group.t \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:22:15"} {"_id": "7cNGSaYtwNjcbnkjW", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all s: Student | one g : Group | s->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CXkghtFZcx7ToZDYZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 18:25:11"} {"_id": "tTFXv3266mkhEGAk7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\tall t1: Teacher, t2: Teacher, c:Class | (t1->c in Teaches and t2->c in Teaches) implies t1 = t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sQNv2Tp9jGhkKDFLf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:33:58"} {"_id": "p3e5rgbqhKs8xNpn6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups).Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7saHC65CceCQHjJHr", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:55:52"} {"_id": "7thPZrgj4vMABqZ8i", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | (some Teacher in (p.^Tutors)\n}", "derivationOf": "F4gAThHCERBDTjo2X", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:51:52"} {"_id": "YdBpYZc79NDKcKGbo", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \t all t : Teacher | some t.Teaches\n\n \n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "RjLCkW8iyaqf86Dzp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 19:21:48"} {"_id": "4qS5JQsX4Wdv2fG4X", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NyPe6AMN3jB26HWnY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:44:04"} {"_id": "tQN8BbpCRnBAbD72k", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student, c: Class | one c.s.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z284aYwNPSyWsLkLE", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 18:03:32"} {"_id": "KvAtenEL9XPManvME", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all : Class | lone (Teaches.c & Teacher)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NYSKSe8XS3pZMpPNK", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:25:15"} {"_id": "BwicFSSSaf3twcSXD", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kPhyRTD3vwvz32Q9c", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:50:44"} {"_id": "WaLjhz3Z4RA4kSLFg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:37:48"} {"_id": "cmMXZBvxvXCDgHvyW", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tsome c:Class |all t:Teacher | t->c in. Teaches implies {(s,g): c.Groups | t->s in Tutors} \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "nNt9o3SaLvGvPfsqZ", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:45:57"} {"_id": "3xpeYKj4mwpNyLELs", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "3kZBqLHNAeqhqfpWX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:33"} {"_id": "dPgyMxbDzTuaQ8uic", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | (~Groups).(Groups) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qMMHLEmY2HmYvvYRX", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:52:43"} {"_id": "YdzQoferNYtnbZ7eK", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tClass.~(Teaches) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZLDi2cp5Zy43PPDWA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 14:07:11"} {"_id": "cvHuZpn6q4jXMnnyx", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { one Student.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tt5Cu7Yyg6tgupui2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:55:50"} {"_id": "HHgWE88XW9QFLzf6z", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n\tall c : Class | lone t : Teacher | t.Teaches.c \n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PSR9YiDhhXqB3LrHi", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:43:24"} {"_id": "GytN2igwMNha258wB", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ojYc2aaZeYHAuahqY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 19:38:53"} {"_id": "rS6f7F8nxtv4nbjDz", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Group)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "goBNPLXtkppGHfZHE", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:57:33"} {"_id": "GkvTGykndxqG39iDY", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a8f7acyvwxk7MArEd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 15:20:37"} {"_id": "oEEr8cXB46FB52z7Q", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ziA3MrqhQwtJrhaXX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 10:31:48"} {"_id": "aFo6xHyonoxqNJ8gA", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | all g:Groups| some c.g iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pKb4aBoPtzjzgAfdp", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:36:24"} {"_id": "Re77Fq4XRwR46Lncs", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches.Class).~(Teaches.Class) = iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "HNexXa3BNaTPCopwt", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:10:20"} {"_id": "TSZnJwHomQsGLtMrX", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s in Teaches.c.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rAwtZQjQizQPn8ESJ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:29:49"} {"_id": "mxWGvWuS8uzv7vwkw", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (((t.Teaches).Groups).Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "nYNyfZzCajJPFvi7X", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:34:38"} {"_id": "mXw4S8wYydwtZ97TK", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | lone t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H5T93Su7xKM2zBDFa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:00:12"} {"_id": "fYevFawD83tLgbtyJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (Teaches.c & Teacher) implies c -> Person -> Group in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DQRD3tbMbH6FBPmFS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:34:12"} {"_id": "N9MmccnqqyNEDBXJT", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PqxmhgXGGhfYWDKsG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:12:28"} {"_id": "6bH9G8g4T5Ni84hiy", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher; some c:Class | t -> c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2JwQXE6ykQ9XN6JXC", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 21:22:09"} {"_id": "suXdyuZkhog5AR6bu", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some c.s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n4gsiK8D7jdvH6fcG", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:37:13"} {"_id": "6Kmnr6ekJAufxgyb5", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches.~Teaches) :> (Teacher->Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tXGTC2gQtwFB5zgzy", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-2 15:23:49"} {"_id": "DSYJFqNxyXoTz5j2e", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher | p.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ma5TcReBEzdWYJ7Ch", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:17:55"} {"_id": "bLyqB6gdJkBaEodmS", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f5p3DfaAEQECrR2Kx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:07:44"} {"_id": "wkbRzG9G4WA8bALYu", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:17:20"} {"_id": "CbMByudJ2QLgxRY2x", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QYagGeN6b7xsLxPwP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 00:00:55"} {"_id": "Gx42iqKzWde4Dzmdo", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "2LA7pyP57om6dQR49", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 19:06:29"} {"_id": "cW2aAgZmLRrEjrm58", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jM8s5nj4vx47PHCRr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:29:17"} {"_id": "TCua2QkSzKPyZtCWj", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Teacher->Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jv9RL2W34bcpdpNrj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:12:49"} {"_id": "K2qBSKfddcbFjCXWX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c: Class, p: c.Groups.Group, t: Teacher & Teaches.c | p -> t in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WbnvFF895Gg7auQKE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:11:26"} {"_id": "TCpLEgEwT3HK8CxGZ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CvreT9c8TSBrnWgBD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 10:42:31"} {"_id": "vq4t5BJt8jzgiBwtN", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (~Student & ~Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "EgL4B4GjsiWTQSxsB", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:53:50"} {"_id": "niWDEzquwhSQQYj4p", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in ~Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HQTXAqCnhTymshQqN", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:28:20"} {"_id": "DYu6h66b6c3dMYFwz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teaches.c & Teacher implies c -> Person -> Group in Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AXMXLihWP4MBp4Jim", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:40:07"} {"_id": "i9GfSXBPzS7jBJDtP", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutors in Student and Student.~Tutors in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dg52CAogGAr3KvWa3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:36:46"} {"_id": "8GjzYW36fwdCc4N6d", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some t:Teacher| some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X2Mf9kDSoeEijX7dt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 00:08:40"} {"_id": "LgPh9KDjRrAZb5yad", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTeacher<:Person.Tutors:>Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kW9kkh3qJzqdNPeNx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 22:12:00"} {"_id": "kyHhAATkHid4j5ubm", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some (Student.^Tutors & Teacher)\n}", "derivationOf": "BwTFge6jsiDvr58ht", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 08:38:06"} {"_id": "e5Zx2KaeSJRLTtSkq", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher . Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LLXzw4QCJTmvW4e9h", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:43:39"} {"_id": "F8fej3Z3LjZunJJxR", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Tutors.p implies (some t:Teacher | t in ^Tutors.p)\n}", "derivationOf": "tidTME6HJ7c2kwDiB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:19:01"} {"_id": "2i6dWF5h8NXKNe3eF", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c & Teacher\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some ^Tutors.p & Teacher\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 16:22:22"} {"_id": "h59ydnrLD24aWLwXw", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in ~Class.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TbWNoD3sYwag4jRTw", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:26:47"} {"_id": "33uzigjkRqMvnb4ey", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TR6yjaxxPM6m8cww8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 16:50:54"} {"_id": "Rc47zPsdAnumwhsts", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | t->c not in Teaches => no c.Groups \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pZiyrtE6WGKX4jBZx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 13:35:45"} {"_id": "NS6mexTqNoLh53PXd", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n\tall t: Teacher | some c:Class | t->c in Teaches and some c.Groups \n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "yCcsr4rBzW29JXeK2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 22:24:21"} {"_id": "HWL5ZxcXroKRFJbuD", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Student, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FKrnA4o5Xr6tCodhM", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:49:44"} {"_id": "KckgYQxJpo6WhiKna", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SxDKf6j5EM3FqBqj5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:47"} {"_id": "qNpy5kYjjjZ6EEYjQ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tsome Teacher - (Student - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HEciNDdaZ7RGdiR32", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:51:58"} {"_id": "tf7JbFqFNZbt32FFe", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tfor p in Person | p . *Tutors in Teacher\n}", "derivationOf": "btqteEsSrFsTSCciS", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 20:10:58"} {"_id": "oyFPH3F4mctzAkZmg", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zDfoMiHbYfojibarj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:19:54"} {"_id": "ogfSBt3T6F5FodtRE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n (Class . Groups) . Group & Student = Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PSfqW6Ccr6PWwnPZ4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:30"} {"_id": "BuHyYqm4cQCtbd3y6", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test { inv5 and not inv50K}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kAfJTursJoWEQsRpB", "msg": "The name \"inv50K\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:58:01"} {"_id": "nGLh2mtcqGR5qDCFS", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B7vNry5h2XWCYwj6d", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:51:34"} {"_id": "YKnvCCiPc6bKsjEj7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Few4XEotBTw63KDky", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:03"} {"_id": "mT4sE8KxwBE3qiv2j", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher:>Teaches).(Teacher:>Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WrZGvbg7o6FiThNZ9", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 22:47:44"} {"_id": "rcyP4s47u3CjZJBrE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7LYMhYjiqMrfiCH2c", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-24 09:30:34"} {"_id": "jucc8pcCpbvPjWMfz", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(all t : Person.Tutors | t in Student) && (all t1 : Person.Teaches | t1 in Teacher)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mMAQJFRNrry9TNZv3", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:59:08"} {"_id": "uebgoqavudR9ETJZR", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SCdH8WAib5iMXcg5p", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:51:40"} {"_id": "mBzrJFDgexLuEbjHJ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher or p in Teacher\n}", "derivationOf": "pSktM8cWS8nzofxpr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:17:34"} {"_id": "KTqPB2QMFf8FwXnaF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n\tGroups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 19:42:20"} {"_id": "JLCP7SD4gLAhGwSNq", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oyunMsrXwWAaEodwt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:30:06"} {"_id": "aWq8BEniNyfhLSwWC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bhkb6vWkrC7ktxFp8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:39:40"} {"_id": "3bbFC6st7kmnaiFmY", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N7Apjt9pDjDmAdEas", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 13:50:55"} {"_id": "ewTvcWfQ6vRfkg5KG", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "unHroMMECTJBP2YEi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:27:25"} {"_id": "GezB69JGgbH67vHQh", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oyFPH3F4mctzAkZmg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:19:57"} {"_id": "MeXaeo2xueQHXRDth", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student\n \tTutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8NWF569cWE7QS5TBD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:46:53"} {"_id": "QzWiXZnsf6qWBwo3h", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors & Tutors.Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jmFwWFaaNpeye2iHE", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:24:23"} {"_id": "ZqfGLbPibDcQmSZNf", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "s3kDL9vqFvG347suF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:59:59"} {"_id": "h7bm9e4FsNaxMXDKq", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c->Student | #s.Group > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wTw7uajLzv6eTzz5m", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:52:37"} {"_id": "xhSzsKMPCuHywBgD7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student = (Teacher & (Teaches . c) . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "E5E8HzkdDFeJoDofM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:14"} {"_id": "3La6QF6Ybo7A2yvAZ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GFCNvjPw3LjQepp5R", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 17:53:59"} {"_id": "4uqYPQWaX3R5hDLXp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kpvfng3risjiTjjrs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:45:11"} {"_id": "fAm78uBpexgNbX8bq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all t:Teacher->(<:s.Group) in Teaches implies t->s in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "8FuHderRqvk3hokLb", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:01:28"} {"_id": "Z8XdmNcTPtE7omBEx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRruCn2E6GCjqi8Em", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:04:56"} {"_id": "XwiGQMfWQg9CEH7Dp", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zKr8rWFM2hd2tffTr", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 485.5555826822917, "y": 265.55556233723956}, "Class1": {"x": 242.77779134114581, "y": 265.55556233723956}, "Group": {"x": 242.77779134114581, "y": 132.77778116861978}, "Person": {"x": 485.5555826822917, "y": 132.77778116861978}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 10:52:17"} {"_id": "HnfCRSrxJQrEvd8L6", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s: Student | some g: Group | Teaches.Groups.(s->g) in Teacher\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q38mW2aK2ykKei7x4", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:05:24"} {"_id": "TfD4NSewefqwnbBvS", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & (Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PoxuBJNzoQ6hPjMvQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:18:27"} {"_id": "N2BKo4ttEbkGMskQP", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | some (c->s->g in Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "376R6otT6jJn5g7dQ", "msg": "This expression failed to be typechecked line 90, column 47, filename=/tmp/alloy_heredoc5889481853443296595.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 18:34:54"} {"_id": "joE8XzfeeFbZDN3HD", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "i2Xzt4ZCCMPXiCLfu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 10:02:38"} {"_id": "GX9qCNnCSuE448u7a", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "w7Dp3PuiMGXCpTMks", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:34:40"} {"_id": "BFXmoAbyLFgFDDNNj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "w9MytBFhAhnmmW4tf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 19:03:44"} {"_id": "TjDzMCX48hMzoYPpW", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tPerson -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e83hPJgfztCE8rjih", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:51:43"} {"_id": "orY9neqTQ8nRuLxPP", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TiubajaaZqSnkNXQF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-8 16:23:30"} {"_id": "Khu3jMHs6hp5RPMcJ", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teaches.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RDnyXdwRi6y625JZt", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 17:40:18"} {"_id": "pyNbiEkTYuDmaxTeh", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teacher in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JLuYkuX9A7vpFf5wK", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:36:40"} {"_id": "LXATHvkyhg6bcDP2k", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-6-10 15:10:41"} {"_id": "wsgB3ZNLNj7arv2BR", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FogKTLetoyR25u2Kp", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:30:39"} {"_id": "JY9k84BqxKtKsjfZL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HwximXSmXkY8PujXG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 18:59:05"} {"_id": "gkwsaeGqtAQdPf3Fp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(Teacher<:Tutors) implies some c.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rp9d4KD7sffMh93g6", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:04:05"} {"_id": "YSgLWKMwE4ztRAQDW", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7s2w5wxZbrRwf4dQB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:58:02"} {"_id": "edtaw2q5H9Yvqe5Fn", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Student | some Teacher in s . ^Tutors\n}", "derivationOf": "YJxwwoZNCFSs9ecNr", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:56"} {"_id": "uvzCBTSE5tXtNKjps", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno ( (not Student) & (not Teacher) )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cxhysKPLStD5upe5X", "msg": "This expression failed to be typechecked line 60, column 8, filename=/tmp/alloy_heredoc12057419857565142908.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:09:56"} {"_id": "k5mC3pfqNdYD9Cquo", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jrgYqimh2xCP572PG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 20:57:57"} {"_id": "r5oWKyF6govycj6BJ", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class + Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HkNsYWKfvhrLFmHZE", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class, this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:00:07"} {"_id": "3D4DinkdCggsg24uo", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher | p.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5NTe2XC6AHmKzy3vT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:19:22"} {"_id": "8EEaYzcNugSnXEZ5E", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in Student in Teacher\n}\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6A2cdKB8C33w5EtDG", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:39:56"} {"_id": "xeTGgB3NA4woAe3EP", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | c.Groups in t.Teaches \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wxnCAHE9o4qJCqraZ", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 00:03:48"} {"_id": "xzfApwhbcWGGsDNn9", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p <: ^ Tutors\n}", "derivationOf": "otpmPmCaDEQwGrXQd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:31"} {"_id": "svpGTb8YnA8YeKrb4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aymRk66bHraXTCH49", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:18:36"} {"_id": "fHSAe5GXbnWviBkmc", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies Teacher & (Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "f9vH6EFHhSx8EH5iP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:56:26"} {"_id": "zpeihE36HCN7D6vvn", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tClass in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2EsTdDA2PhYHc95ms", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:26:34"} {"_id": "EJQcNHRDjJLWxEJvj", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nall t : Teacher, s : Student | t.Tutors in Student and Tutors.s in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\nall t : Teacher | some Tutors.((t.Teaches).Groups.Group)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ijvko9crLrf49wQY2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:24:50"} {"_id": "G2A8TE4jaaR9K7Tib", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher in Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ig4cm3PQ2BadEgex3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-4 07:34:05"} {"_id": "dcBeNAciKypLQyYjs", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no t^.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qy8h49FZtAcJ7WF9W", "msg": "There are 25 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all fun iden let lone no none one seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:58:09"} {"_id": "r6yWec79qR3ti3stR", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "7otzpgEDSfScasXEL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:45:35"} {"_id": "44iaXWsfE9Zm3M4gH", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t \n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rqfmJ5Gys4Gx4rZWG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:21:20"} {"_id": "tqarMXxXEv9p3CGgE", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | one t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2etbh24kqPg3qh5eP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:06:55"} {"_id": "FoJ2dLRdbySLHFHNR", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | ~(p in Student and p in Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zXDGFCNS8phT7jfFG", "msg": "This expression failed to be typechecked line 55, column 17, filename=/tmp/alloy_heredoc15821237581191816937.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:49:55"} {"_id": "enpT2MFjGintQeYYp", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | one Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "MExoP8rpgBc2FPBAf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 22:55:07"} {"_id": "P7uNJSwSv5FpHkff6", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | lone t.Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8iY8nK7DKbHz2Z5EM", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 12:35:21"} {"_id": "44xkud245NjoAGGuJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeacher in Teaches.((Groups.Group).Person) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3NeqxsKCyttYQNSgG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:00:51"} {"_id": "3T7urcrgp6ZLA9kGk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6wN9nM7bJiaTriWR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:56:42"} {"_id": "5AkFR8XwxnWLCXZuE", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, all disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RPSBTQtof8JaPnr2Y", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 15:48:00"} {"_id": "4dhhFCQxRMgGt3M4z", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some Class.Groups & Teaches.Class\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dnj3gj4zwa64XSLiR", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:00:54"} {"_id": "kRofHXMLDs2hM6DHj", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6z9Wgbp2mXM7r5uqW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 10:02:54"} {"_id": "t5NokTo4tZaQi96D6", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all s:Student | one g : c.Groups | s-> g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cM2RfnRYdrFeZAKvj", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:01:45"} {"_id": "rEkxAh7HMnSXGtvrB", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "R9xwp5HNuMeduj9yX", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-5 10:55:42"} {"_id": "yg93NdBxxekHk3tuq", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t : Teacher, s : Student | s in t.Tutors & t in Tutors.Person\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3tAdSERH5pnMB58wb", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:39:57"} {"_id": "LtXDCN6SM6EhDWj84", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person -> Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FmSsn4bQcs6pXWHfD", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:35:49"} {"_id": "BigpFwPzctd9LMzPh", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jXvSbEFuMTpuwuoxP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 17:02:27"} {"_id": "AGSFRtWWjW3cETWqh", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t:Teacher | lone Teaches.t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xjZLsS4ojJerjaZgN", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-13 18:28:09"} {"_id": "QsHxf8Q8DpzzChADe", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| one Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rNHc8uD4TRX9Fijkj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:44:52"} {"_id": "cFW3QWFb2L9qMhdvm", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YEue97NmTDCHRAWNb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:07:25"} {"_id": "YvGKmuq9CpW8exzan", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, p1, p2 : Person | (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "eyH7PS4B3NKQBg5CB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 18:20:48"} {"_id": "rqfmJ5Gys4Gx4rZWG", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t some Student.(Class.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u7xnQYm9gbqa7AbEX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:18:58"} {"_id": "GjxczyzXeMdArsC84", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class , s: Student | some s.(c.Groups)\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 { Teacher.Tutors and Tutors.Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2qnMwcWp7Sz83x8hT", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-19 19:57:28"} {"_id": "eR7Z7MzxKcFqHHSav", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pix2AtKJsZj6RbhZN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:54:32"} {"_id": "Zti3djkWftA6j7hd6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n no c : Class | #(Teacher & Teaches.c) > 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups implies some (c.Teaches & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5FdENJkmFkMoxSbkQ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-8 16:28:15"} {"_id": "MQ4BhhNL7Ho4cEgeW", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher.(Teaches.Class) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iKHiR2WvJX8JTF8tE", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is (this/Person <: Teaches) . this/Class (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:36:11"} {"_id": "CeY4woNmbXMhzda6g", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all p : Person | p in Teacher implies some p.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vFxaPP2FYxhGhHpin", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:14:42"} {"_id": "nYnemoC4htGfdhZT2", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s . (c . Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (Teacher & p . ^Tutors)\n}", "derivationOf": "fvAAmeWR3qPHqTxxH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:18"} {"_id": "JSHrnqh8MDSk9AnCZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AFGfPMZefFPujWfdi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:19:47"} {"_id": "QdrNTX6JW9szcqape", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DNoan3XPJMby8i59G", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:05:31"} {"_id": "ky6oChxW9QPLZBu5X", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MXgFKKwYezeyBhRhw", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:59:02"} {"_id": "DHJMnoA6eZ6ctBwN8", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { one Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cvHuZpn6q4jXMnnyx", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 22:55:53"} {"_id": "zPdCMzHAZgaSqLppr", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8ur3aFhMQkNf5zsrj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 23:31:33"} {"_id": "kKPE54yrgxNxruHiB", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Tutors and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "A2gSa3ZpSf3S8yXhW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:10:26"} {"_id": "ZwoXCfoC6bXNAApZG", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all s:Student , t:Teacher | (some Tutors.s) :>t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "gdsZAM4HpaYmMdykt", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:08:28"} {"_id": "8epjDZb43R8j5vajz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Class.(Groups.Student) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yXdxkQz8RuKK2gBmW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:23:13"} {"_id": "6SRtX8sMd4yovGyAd", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TfD4NSewefqwnbBvS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:18:34"} {"_id": "suNtFoL3kLmjSDAZv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "THjEHRgJeQ5j6cMpC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:58:07"} {"_id": "aARw6amA6HRu89s5z", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n \tClass in ~Teaches.Teacher\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n let t = ~Teaches :> Teacher | t.~t in iden\n\t\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (Teacher & ^Tutors.p)\n}", "derivationOf": "aLgzTqLkKyKymxHRt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:34:15"} {"_id": "Ruax2cFku4rfh7CXK", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "oMdquEMGx3QjZGhHw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:22:30"} {"_id": "kAhBZ4znRwRxKcWb7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Group | all t : Teaches.c | t->s in Tutors\n }\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "DnTjCqSkHBYjC8Rtt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:43:50"} {"_id": "GNr2AaLpHuWuDJuEj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some c.Groups.Group\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CXB5gWvPM7u4Wg7gy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 18:25:36"} {"_id": "KRH3NknMWJnssTNY9", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "CRpeJmDtoGzzW6pw3", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}]}, "nodePositions": {"Class": {"x": 444, "y": 265.3333333333333}, "Group": {"x": 592, "y": 132.66666666666666}, "Person": {"x": 296, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2021-1-12 23:45:04"} {"_id": "WCEWZeRZcD6xv92hH", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X6eRdagQTxbPEMkmm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 10:45:05"} {"_id": "wqJex59KxLvFPgK3N", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | ((Teaches.c & Teacher) in Class.Groups.Group)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gNmhNHtPfu2B4yemq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:24:31"} {"_id": "ci22egRh9NqKsyNdY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t~((Groups.Group):>Teacher) in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m5K4NntxbWJxkDMN5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:25:32"} {"_id": "RgHH8v9TK2BpxPTdJ", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tsome Student + Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3kXzyvNzymBN5QrxN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 14:50:19"} {"_id": "jjR8h6DRo8CJcsWDY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Teacher = Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hszdCPsq5wDfQ4itY", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:29:06"} {"_id": "fv9wqr2YjFgsrhAyB", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "MymAimuaLHgAQTu9y", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:30"} {"_id": "HD8fREMtvYN4MmrMZ", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (all t : Teacher | t in c.Groups)\n}\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u47K4dD6JCzyzoCN7", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:35:13"} {"_id": "2RXwSN2ETcakrukwi", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GTnYgWjf34geqTHAx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 16:57:01"} {"_id": "n2NBdmApMJ9BZtPoP", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Student -> Class)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CxECQmv3AYHLNah8f", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Class->this/Person}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:51:08"} {"_id": "Ws3deCPZanApfzkg2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c) - Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7y393NTXZehHigoDk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:42:17"} {"_id": "xRxBcFw8ut7NWksDe", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tiden[Teacher] & (Teaches.~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZbnCr9Ghyw9HfEf28", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {univ}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:17:29"} {"_id": "srvstTLoTAYi8cS6W", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class | all s : Student | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z33ZxS7y25Mc7icNZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:08:17"} {"_id": "Nq5evtEGarfgJhCph", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | ((Person -> Group) - (c.Groups)) + Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rK3tDGMzwaWfbzEZw", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:52:55"} {"_id": "T9NXdcTecgzK9XTk2", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vw5TPji3bJutJ3E54", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 20:38:57"} {"_id": "sW8HThhPfkAkGgeqd", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Person.(^Tutors) -> Teacher\n}", "derivationOf": "MpmHo6KYjkwYNhcjY", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:25:46"} {"_id": "hHRjYx9wYqccv3FMS", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EBzzhwpeD8nZsjbBJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:09:38"} {"_id": "9kByNASEwSLKnWBS8", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cwauCdvR2btmmr2Td", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:42:27"} {"_id": "aZtaGPidDMjJ3PExB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | Teaches.c in Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C4xFSD2vRzLY72tG2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 18:40:05"} {"_id": "5aE6CKhtdCxddoL2Z", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c in Groups implies Teacher in c.Teaches\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pr2szZKLnGsNvGXoP", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 14:53:26"} {"_id": "PwgZBS8Zs9CPdzHu3", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vRJGRYE7NxaZCt3FB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:56:25"} {"_id": "bahQCj7937ur9NMRv", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ns3i3Q43KFZnAPKgs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:15:53"} {"_id": "w4iiu5pxz4f2ik29g", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "LKykxWcF4qAe6zNTW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:52:37"} {"_id": "KfdyWBmjXWMeHAMZn", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c : Class | lone c.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rWGoK4QjZxPeNi5pm", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:13:22"} {"_id": "Su9tG5KxYYf4T9Brs", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some Teacher.Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QPTtJ9fZMH25b4rHE", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-9-12 17:00:09"} {"_id": "YNXj46QGcdAyKg6Gf", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (*Tutors.p) in Teacher \n}", "derivationOf": "SuhkyPiLnkDvbByoA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:17:24"} {"_id": "zFgkiN6HYtDcm7XEh", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KnAyubHjALZAYFPm7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 19:47:02"} {"_id": "ZrBmLw7WqaMdLhSJC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "95JH7dr3963DpwsAp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:41:58"} {"_id": "QYXWoL2HjA4S4wQWq", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . ^Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fg2tffSuouuzPLqPB", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 23:03:05"} {"_id": "z8RM6m2QZmWH3DYk3", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Student, t : Teaches.c | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QySJdhnKawSPhEfo4", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:50:31"} {"_id": "88AgqauA6Cm5bfLBg", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n (Groups.Person) & Student\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "ZrAt7WNSzrZaSzveW", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {none->none}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 12:28:31"} {"_id": "9CopNFQYs4z8wDEwL", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N9MmccnqqyNEDBXJT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:12:55"} {"_id": "HqDGG7gnRc2i9X7aT", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "yrErom9ZHtJZp5PaH", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:55:21"} {"_id": "TFBzzAidvkpGethBw", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) implies (Tutors.s in ( Teaches.c))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FThHWnaGztsZZnjFf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:26:14"} {"_id": "fHs7nkusqo6wdhqh5", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Tutors.p implies (Teacher in Tutors^.p)\n}", "derivationOf": "bLpbu6McvYHZ7hpwQ", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:13:33"} {"_id": "CZwGffYjFdZwwpLu5", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ccJkoctsWzrzQ7SR7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:13"} {"_id": "kQiByLmNJeogXzqkr", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student\n \tTutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y6utKm8L9C3vTL27D", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Group": {"x": 535.375, "y": 199.1999969482422}, "Person": {"x": 267.6875, "y": 199.1999969482422}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-1-2 16:03:23"} {"_id": "NXASWGJryDNzcZbM6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t#(Teaches :> Class) = #Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jadzEzWN7w5BST8uq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:56:27"} {"_id": "BfrbF2uYxexn5pJPj", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches implies p1 -> p2 in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kjtXvK9gJhj2X2tKq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 19:26:40"} {"_id": "wyCEZEWGgrz3jrYLA", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8uHrDZDBmFDLNMv3c", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:10:16"} {"_id": "smCgFKtp5PhiqYE85", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Czuz6yLgwevPjYcfX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-30 01:14:07"} {"_id": "sS9C6pMd3jh3qoNHw", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | t->g in Groups\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yLXKRH3LcmqLR3nG6", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:54:14"} {"_id": "bDBSW5iBB3eK4qoRp", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c:Class { one t:Teacher | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bp9M9TxaAkxDW3fCH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 03:58:34"} {"_id": "JxSz9aWJpwzCMMcof", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x3pHnCMgpistuQhP7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:21:20"} {"_id": "cpnXFequXq6WLcw7D", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "Gx42iqKzWde4Dzmdo", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:10:01"} {"_id": "CGcTWKLXEvjP69san", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some (p.*Tutors) & Teacher \n}", "derivationOf": "32RZjA65cBCEmdtBT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:01:25"} {"_id": "Z22xom6QxbGqrysjA", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person | p.tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DC3HKhSNFnDq8jAKp", "msg": "The name \"tutors\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:59:18"} {"_id": "fNSm99ZCKg7CT4z6i", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NGF3fDsyp8QyKKQ35", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-12-8 11:57:31"} {"_id": "qSFBGxCRD6SvmpHnA", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9hGCdfprsysZPAmNY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:22:24"} {"_id": "Q64TQB4uLDeb8Xsny", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups :> Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t5vSEHuYvSGNKTPDY", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:56:38"} {"_id": "Sf9vxSrFqKLT7Gs5D", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person |some g:Group | all t:Teacher | t->Groups.(p->g) in Teaches \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "pvP63KTYL6ATyL4o8", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none->none}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:35:57"} {"_id": "Jv9RL2W34bcpdpNrj", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7qkttQsagLBmLjM4z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:11:58"} {"_id": "wZrxNdFMxh2EvrGYn", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c in Teaches & t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z2k76kmy8RzAiBKrs", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:25:19"} {"_id": "uP4rXobqHxvDS2yXk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall p : Person | some p.Teaches\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hs2m9XStdHRKboNWQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:50:27"} {"_id": "BxcF8kaFgBH7Bhwnf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone (Teaches.Class & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "744K6DZ2ivN9hB8AZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:09:04"} {"_id": "pg5SihazPu6PeKY2j", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "Wt3zbXPfvRQJmnMrv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 09:45:45"} {"_id": "DZCjo9rri9pYGYY4q", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mEGHycDBPshEMuvfr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 10:38:59"} {"_id": "ThL9t8PQ2C62u2pgt", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HFXrX2u5FA5rEEd8b", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:57:03"} {"_id": "2e5f65ew37WhuJujh", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cwGnYnHkcsG9sjEup", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 17:03:27"} {"_id": "8aTb8brFGDRX3oad8", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | one c.Groups.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ExivcWoMkQK9fwpHr", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 14:48:42"} {"_id": "RLiTrLNKwLrdvcZNT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches . c . Tutors in c . Groups . Group\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GaStn9o2FsDre7tDS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:30:12"} {"_id": "svNq2FDYtDxwWi7Cs", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t~((Groups.Group):>Teacher) in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ci22egRh9NqKsyNdY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:25:44"} {"_id": "pHQP7vc8Dw7gaq2Kx", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTeacher.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BAssa6FJFdxhQKXi9", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 22:13:50"} {"_id": "PKzcGBDryS7pCjMFX", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t^Tutors\n}", "derivationOf": "HorqXGZc4wgP3YPnj", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:53:40"} {"_id": "2hy8pjo2t6YM99MBW", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n none Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XqKu5ySAK7obhL2kz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 15:37:42"} {"_id": "P337bcuKzHR77yp5o", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | Teacher in p.^Tutors\n}", "derivationOf": "T8m4SPoKaZbufXBu2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 18:48:11"} {"_id": "a6tW5q2jXWE9vEBHx", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JoqjwK8W8kTTPAEv5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:29:14"} {"_id": "omBz6uZc658QfXHaW", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall p:Person | some Teacher <: (p.^~Tutors)\n}", "derivationOf": "zoRqWoDosjjejWFGb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:34:11"} {"_id": "GNRXZCZqWwYnT3Qkx", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher not none\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yS5kofyqg96NRFiQ4", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:36:09"} {"_id": "PFi4dvKRRFAQaADJz", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sYGrGTvp9kFW2FzJ7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:19:29"} {"_id": "7YRokEPa5JAua8ysR", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some Class.s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SyXftfhikgTPFBFFi", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:20:03"} {"_id": "S6CbzWguPTAJPv5QE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.^Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d38xpQAsquqbDrQMi", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:57:18"} {"_id": "6bqp4L4xg2k4ue57m", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ueFiZf9W8DRQJ6JNj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:50:37"} {"_id": "DgoSDZ3uj8vRd8aYc", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher or Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xBuH9DScJY2STXmRv", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:37:21"} {"_id": "uczJhAkcrviWqfyz4", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p not in (Student + Teacher) and no p.Teaches \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BkEBEp8D5JT4MESTJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:45:50"} {"_id": "rbXGRJwsdjAQm95cz", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\ttutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aWtFCe4fJfE3TMgiw", "msg": "The name \"tutors\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-25 16:15:25"} {"_id": "pwXqeqNa2CuFYWHJK", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PKRXf4LWpsQgMKhJC", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:25:39"} {"_id": "dCTpowyrkNmvQRApJ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tTutors = ((Person.Teaches).Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DMBc2jqjo2smDzv8F", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:50:08"} {"_id": "Qqt7FLcDGkuzHFKEm", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2dZZ5szQszZ6AHk4X", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:44:08"} {"_id": "cdWStGStiugDRg77Q", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher.Teaches<:c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uPMLtqKfdGqz4Cy3M", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:51:32"} {"_id": "DjyeMktaN2pnNdW27", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Tutors.(c.Groups.Group) in Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gnFhWxrPJxHk9xYFK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:10:37"} {"_id": "vNKxHJFobQyCJwinr", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches) & ((Groups.Person).Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "Xt6pdqb7DzowAEEnE", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:08:34"} {"_id": "abN5wkKYEsS8cDRhi", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vPhrTnS8bN38bQHCf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:31:47"} {"_id": "6FZeg23RBwz4TenCF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class -> Student) - (Class -> Teacher)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4NXYBJ7g2wcCb5DCq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 23:07:15"} {"_id": "ycLzwaL5s7qhAGYaY", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (Teacher<:Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P868YvkDYjgyPnoem", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:47:16"} {"_id": "WcGBDQWdHrd8FoCzw", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WMNfZjLDpMzRyLdg6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-2-24 15:27:41"} {"_id": "Qndh7uCAkQFeaKM98", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches).~(Teaches) = iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "Re77Fq4XRwR46Lncs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:12:00"} {"_id": "95LKNg3QGeR9W3zwB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t~Teaches.Teaches in iden\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dRheifNJ3TWPQbGdd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 20:01:12"} {"_id": "EoxPAkeKXJ7PNf2Zw", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class:>Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FTzFoDuGpkkt2siW2", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:22:14"} {"_id": "JrE26NMH8Ew3Qs48R", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some t.(Teaches.c) implies s.(t.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wPsC9cQ7vFc8hgQ5F", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Teaches) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:56:29"} {"_id": "P3cezXwiy8Xuoxngv", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zwd5Fv7vJvi8eCAYM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:51:32"} {"_id": "qCcZSr3yuAPkydQkm", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (Class<:Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tb3Q6zogLNHMGzELv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:17:51"} {"_id": "5tuqbJXjgqvFoXq3x", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n Person -> lone Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BBfuRTeZEH3RegxLp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 17:44:32"} {"_id": "LvwyYMREamYDRdJZY", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BcoTLBjxJDQYuGLeq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 17:01:31"} {"_id": "aftsuKKBKRsT7pZsr", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(~Teaches :> Teacher) . (Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some c . Groups . s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rMDuP7SHeXZZXmcBY", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:50:58"} {"_id": "xC5GApQMj9FXRSqks", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t lone Class in Teacher.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MZQEevce98mhooXxn", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:44:54"} {"_id": "5m7328wbAQBmvrA89", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6HqPih7LcjT8fHCzA", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:12:10"} {"_id": "39N4cxB9MbpwkSdnm", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class | Students in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HcKokf83TvNLAfFNo", "msg": "The name \"Students\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:28:44"} {"_id": "XTpgXC5xGnf4BBjvj", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . Class) = Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7K4LwW7DhhHf5TNJy", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:03:08"} {"_id": "2KmwvuDuht3i2hr2g", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.(Groups.Group.Person) in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RZhQMxgMT2F7tkshN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:58:53"} {"_id": "5RRu8un7ygEz8ibbR", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | Groups.(s->g) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sj8DfjJwqZeKZc6Dd", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:23:24"} {"_id": "YrWG75CMZwfS63fL7", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h59ydnrLD24aWLwXw", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:27:01"} {"_id": "MRiyDRxSaMdgNtasB", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some c . Teacher->Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zxjGy5APmJX2L58uJ", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:53:56"} {"_id": "jo2vPGMFizCZQt3Li", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "967FpRoekDmsbd2Pv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:26"} {"_id": "gsgSazrv4Shi44pws", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeacher.(Teaches.~Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3AWznx6jriMzJJYiz", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:18:19"} {"_id": "GgtovYWTdgDZYnLnM", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "3xpeYKj4mwpNyLELs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:35"} {"_id": "eoQQ4aoQ5WrNKqPzT", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "ofmvtRivi3FXrKLnc", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:07"} {"_id": "SCdH8WAib5iMXcg5p", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DAyDYWYPgCosXRXB7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:42:29"} {"_id": "Dnj3gj4zwa64XSLiR", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some Group.Class & Class.Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FsELDxKvLpH2iQdQ8", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:00:35"} {"_id": "CkDN4qC4Nr5grjyik", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FF2KGAvJFaPbXDFez", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:17:14"} {"_id": "iove8Td7ggS9ZACgZ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person, c:Class|some g :Group |c->p->g in Groups implies (some t:Teacher| t->c in Teaches )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "9p5XwJWNBsqBrppxT", "msg": "The name \"t\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:11:01"} {"_id": "rWu5fBSW3toF66stF", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t : Teacher | lone Class.t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qYDWDhXMbrCwuy75b", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:01:57"} {"_id": "Nq35NcyfkCHpKAyTX", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some (Person.(^Tutors).Teacher)\n}", "derivationOf": "uhdQ8bhDXeGrrxtew", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:01:41"} {"_id": "WR4cpPy5TT6ivrbBJ", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t <: Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XNDNHtcpQKoq4y92j", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:44:08"} {"_id": "ts8QpN58BNDL3GBaC", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall x:Class| some Teaches.x\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M4NwEZcGNqEWWsD2e", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:34:38"} {"_id": "8e4P7PrYYJywXv6ou", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class, p:Person| some p.(c.Groups) implies some Teacher in Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N5LjkuDRscqnfnA29", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:37:23"} {"_id": "kBmX4J33JYTnmphXM", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "3z92aiYkxrHWRhKHq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-19 10:11:26"} {"_id": "syzPBMCHMag4d825N", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "3B8JzqhBSoJt3m3mv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:19:33"} {"_id": "KWZ3xEmRT4m65gCSH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall s, t: Person | t->s in Tutors implies s in Student and t in Teacher\n}\n\n\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s: Student | some c: Class | all t: Teacher | c->t->s in Groups implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "psgQMpP86p2bhgf24", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class->this/Person->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:09:52"} {"_id": "GqeSnrT8CrPFTPtAQ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies (Teacher.Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "hMDezQ4WtS4mLm5KA", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:56:11"} {"_id": "93YvGQxLhEt2WPxgY", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Person.Tutors and Teacher in Person.~Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i9GfSXBPzS7jBJDtP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:38:40"} {"_id": "8TBzMyjn4JCGfxAMm", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (Person - c.Groups.Group) + (some (Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JcCKQyfarkS5hL6Ca", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:46:54"} {"_id": "6GGWjjJ32bE92b7Rk", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c->Person->Group\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bHuWCQNDcuzXMFxTt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:53:21"} {"_id": "fro6KyNJBBFWy2AZZ", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | all c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DE4iTYxaHQtztqbpL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:25:34"} {"_id": "ArB7fmC2vGHMaBGaJ", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all c: Class, s:Student| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {all p: Person| some ^Tutors.p & Teacher\n\n}", "derivationOf": "SGFdPN5D6jojwf4Fc", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 206.83203125, "y": 199}, "Class1": {"x": 413.6640625, "y": 199}, "Class2": {"x": 620.49609375, "y": 199}, "Group0": {"x": 206.83203125, "y": 298.5}, "Group1": {"x": 413.6640625, "y": 298.5}, "Group2": {"x": 620.49609375, "y": 298.5}, "Person": {"x": 413.6640625, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-12-18 12:21:12"} {"_id": "fEjcxCWEwvgKCB3gB", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uHirtqLfkZvCmdrvC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 00:17:19"} {"_id": "kphevRWrY2t3pzTij", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mbmKguBHecugFp7wF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 16:03:22"} {"_id": "NP3fQ89maCw4HEHio", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in (Teacher<:Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j8vhD9b9F3xyoXMft", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:46:53"} {"_id": "X2oTZiRhxZZmdjm5n", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iXNJsXcBDXz7mntiz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:56"} {"_id": "nFqpAQ6GvvnrQLnrM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5Cxf3LwDi6nqq5XAy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:48:05"} {"_id": "uov3P7ahXi7JeqrGe", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | Teacher in ^Tutors.p\n}", "derivationOf": "rHYJxnasx8bdXhNWX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:10:45"} {"_id": "7tqceFphwwuDDj6k2", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tStudent & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wyCEZEWGgrz3jrYLA", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:10:25"} {"_id": "XYzmx5fAQumTTkzSN", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Person.Teacher + Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zh2dPsYYcHECfwoAg", "msg": "This cannot be a legal relational join where\nleft hand side is this/Person (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:33:06"} {"_id": "vrLGaC4ceRY9ZkNkg", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "i8NSApFdBTzy32Bkh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:44"} {"_id": "wCetgWTRRCuLYakDz", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | some ~Tutors.t\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8EzN8Mm8W92rComrm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 15:41:49"} {"_id": "GhLQWDHbFQhZvgQtS", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teacher.Teaches\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xe4kTXqd7LxQR6ZLu", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 16:07:30"} {"_id": "ADDhRDtYWeMsRa79j", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \t\n \tsome (Teacher & Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tNuAhyMYZJJM2ty5B", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:35:06"} {"_id": "838Cwe83FiM67rEP6", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall c : Class | some Teaches.c in Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "amFT2vdGawCLnnpCD", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 16:01:55"} {"_id": "6EQifSuLChJXMndKd", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c and Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H97qhWqfwqik54zfC", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:31:47"} {"_id": "LQ7J9AjPzx62XQAQw", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "xAHFob6QC2vHexHZT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-16 03:30:29"} {"_id": "wpK7h9Gt6EZ3FkDHa", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "JWPNSRPimiHmmf3Pw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:29:49"} {"_id": "AdqhJoMFPaQFwFcQF", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H56NSxBaihzTodCnZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:38:25"} {"_id": "uWrZ8sgQ9qSfFdnR6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pBanQKQgZctHji2pp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 20:36:59"} {"_id": "BL6PxCQ2KyLRAyMBL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XXrH4o9AS6aJtp57w", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:31:14"} {"_id": "R772NpL4tmNPEDBSp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tXtR82htKmmJzZme6", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:04:10"} {"_id": "aarA8dDBcn3CJZ6FL", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) implies some t.(Class.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GoP7JJLocvp7eh4MB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 11:55:21"} {"_id": "FAptmpsfCdKjYvEkT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mGTXz6XoTeL88C4Bd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 16:54:58"} {"_id": "prAWhg2JGGDquwRuR", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "k9AukqtSDvZSEdseG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:57:46"} {"_id": "e6iSP6TpiAeoM3QkZ", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WyauK6bD45gWdE22s", "msg": "The name \"teacher\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:53:54"} {"_id": "n3kRRFeLz4HAecBMw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | lone c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vHKHZdMqqZaNZXYkq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:35:21"} {"_id": "ExivcWoMkQK9fwpHr", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-25 14:47:33"} {"_id": "Y4FJ3nTCAtiZqqZNQ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HaCHmrdSjjio4toBC", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:38:08"} {"_id": "qiCRG4tpN44pR6ig4", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Teacher in Person.^Tutors\n}", "derivationOf": "aiwadPmpeipNxvrrF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:09:06"} {"_id": "cHSGfzmEuqNFcH5v4", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | #Person.(c.Groups) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wJ9grGZupPELjD999", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:42:31"} {"_id": "954KXKPr2ARTnFuKT", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all c:Class | all t:Teacher | (s <: c.Groups) and (t->c in Teaches) implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "7pWjLZkaCr7Djdzod", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:29:57"} {"_id": "7K4LwW7DhhHf5TNJy", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . Class) = Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NmMhueiFke3qEnHF9", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:02:55"} {"_id": "hszdCPsq5wDfQ4itY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Teacher = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GWCEkoCyTmchMvKLi", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:28:30"} {"_id": "K7vnewqcYE7Fv9rB3", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tsome (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B8y2Y4EWFqr4cikre", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:52:51"} {"_id": "744K6DZ2ivN9hB8AZ", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone (Teaches.Class & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t:Teacher |\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "42cq6cgwz4g7rSzFg", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:08:55"} {"_id": "7pWjLZkaCr7Djdzod", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all c:Class | all t:Teacher | (s <: c.Groups and t->c in Teaches )implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "fQ54bsfmK72SiQPAm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:29:42"} {"_id": "ZjsuK44s497Fs52rn", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeaches.Teacher in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nd4EcmNKNX2qbok7r", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:17"} {"_id": "qRKhNoCTS7cAkwDWX", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t#(~Teaches.Teacher) >= #Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r6idsZiBrhWoKXdFN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 20:12:53"} {"_id": "RNdnEqooipPEdF8MM", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all p : c.Groups | #Group.(p.(c.Groups)) > 0\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K4uykX82oSN2NWbNj", "msg": "Analysis cannot be performed since it requires higher-order quantification that could not be skolemized.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:56:06"} {"_id": "HNnFBKkAdSMY2Z2p3", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and no Student.Teaches\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wctNS8GrpDNSwPc4y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:00:19"} {"_id": "FYpt8totLrT6CEpAC", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall p : Person | p in Teacher implies some p.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | c in Teacher.Class\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aDzHJouYWHd6ueBf2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-19 18:29:42"} {"_id": "Kpj2wNkarvXB5nLFJ", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass & Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t-(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fDJoSGm2b3vR3NEQT", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:57:30"} {"_id": "WyauK6bD45gWdE22s", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yEbTiCLN9eAkyuj8M", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:51:23"} {"_id": "awzczYr534JkAHEzN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no (Person-Teacher-Student)\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n \n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun inv9", "derivationOf": "2Pej7phAxbTjbZGRB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:35:27"} {"_id": "nB5hfLMhKNnoKGrfH", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.~(^Tutors) in Teacher\n}", "derivationOf": "AKPxE4GeC3viirwES", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:57:12"} {"_id": "THjEHRgJeQ5j6cMpC", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rS6f7F8nxtv4nbjDz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:57:41"} {"_id": "AKPxE4GeC3viirwES", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "bARrTLp2JykDZ5G9m", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:56:19"} {"_id": "DAyDYWYPgCosXRXB7", "cmd_c": false, "cmd_i": 0, "cmd_n": "run$1", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun { some Teaches.Person }", "derivationOf": "Z292nYPn2rzEyuPqs", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:18:58"} {"_id": "w8Sd4Rw5dsbNP2e7r", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups . Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:50:32"} {"_id": "tcs3JeLQwmYncxpQP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some Person.(c.Groups) implies (some Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FiTuQucbXeytAyg9Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:12:35"} {"_id": "yPiCjTbZYSNvqm9Zw", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6EQifSuLChJXMndKd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:31:53"} {"_id": "LQfucNAnnHwh4xKrK", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some ((Person - c.Groups.Group) + Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CymJs7xx8MYDZbLnY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:54:57"} {"_id": "CRpeJmDtoGzzW6pw3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "XMNeszDP9xwLsSKTr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 23:44:58"} {"_id": "Jb8Xo5dkWjuK8F4TF", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PNcmrAKZ9cz2Hyrww", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:58:07"} {"_id": "jTMTeFcWFyf27az2u", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies ( (Teaches.c & Teacher) & (Tutors.s) ) in Teacher\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "5d34orhcEWpmCHaJY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 14:10:44"} {"_id": "GLsjZ8TjT5ZecJbun", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (lone (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "MKErv2gaAMWtccEiS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:05:40"} {"_id": "3AWznx6jriMzJJYiz", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches.~Teaches).Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uguZzo5G6X95dgXw8", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 21:17:56"} {"_id": "vfxnhzkTqQMznmTLX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | one Teacher.Teaches:>c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oX2yp8whrkzpGWMNt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:35:48"} {"_id": "ewjhiEPZ6JeLYphCw", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D57cMDaZmtJkJgXXW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:12:16"} {"_id": "zno5FcNaBLNJc29dC", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-5-7 11:16:09"} {"_id": "Jg8pJ9CMZidCokKqh", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QATgbza96shJufnH5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 19:56:54"} {"_id": "GayMWWz7M6P9rckrT", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NwtHpTmAAuXrMPLkW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:16"} {"_id": "NTgcqzgRWfhCSa52g", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eJ9uzSsYAEhTBWSkW", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:14:39"} {"_id": "bGxeFyQKgP8cK3Lou", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cvNow6Y7qsMcg37Jt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:12:54"} {"_id": "hYKqwQgehvq7zyD5y", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "mQ3AfmBXxyLzLk9re", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:25"} {"_id": "TX5nQK9y3xB9h6MPF", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n Person = Teacher + Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5LxMngvhwKEktyRKQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 16:56:23"} {"_id": "5yYFptTSsK2pz6r2g", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.Class\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7YRokEPa5JAua8ysR", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:20:12"} {"_id": "XKiCwRT2d592vCDqZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z5vmQMkEsyLuDs8ph", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 16:39:10"} {"_id": "fQuN2xm92RXQtnn3v", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (Teacher.Teaches).Teacher in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iS2ffGQ9SfD9D9wjn", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:35:27"} {"_id": "t42BbnNGivDNR6bG8", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student,c:Class | some (s<:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) ) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j9BXB68DZewiWkKxK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:32:12"} {"_id": "WT3jTb6H6Qx6cCZTY", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno not Student & not Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n925Cah3K5Sw5iJwH", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:10:54"} {"_id": "uAezNErGvTaY6irpj", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, p : Person | some p.(c.Groups) implies (Teaches.c in Tutors.p)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G4HAE7xrgXruDSJdS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:41:36"} {"_id": "pM3NQSCeDtSsgMyzn", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches >= 0 && #t.Teaches <= 1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teacher.(c.Groups) < 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HtyCvTr93Judapqft", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:49:35"} {"_id": "Hrr9ovMjfHMRkd9n3", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \t\n \t#(Teacher & Teaches.Groups) > 1\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ADDhRDtYWeMsRa79j", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:35:14"} {"_id": "Yd9q9CeZQT66GFw33", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | some (Student.(c.Groups) & Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "tWZte4orYqNbHgAHi", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:39:04"} {"_id": "oARhtJCFdwnfXJPN5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Person | lone Teaches.c and lone p.Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eSyvEbNWWLDy4RjBe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 22:50:58"} {"_id": "3p55MMfhqr8jjFQHr", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "s2tE8bmcMMqc4H9mH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:19:49"} {"_id": "ueG99M9YSAoGQzkGR", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YkGFfdvjo2FDJcABd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:44:54"} {"_id": "Gt8eucurDaLSjKhbZ", "cmd_i": 0, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location {}\nsome sig Name {}\n\n\npred noSameOriginAndDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\n\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\n\n\n\t\n\t\n\t\n\nfun busLinesForStop [s: Stop]: set BusLine { all b: BusLine | s in b.stop => b.name }\n\n\n\n\n\n\npred test{ noSameOriginAndDestination and locationHasAtLeastOneStop } \n\n\n", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Name}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 16:45:34"} {"_id": "t5vSEHuYvSGNKTPDY", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups <: Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P9t3dRm7wgoAnKSSK", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:56:30"} {"_id": "yL4oy9AWgtGLptEZS", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | Person.(c.Groups) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CqfZ96yFHmpd2KcNN", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:40:01"} {"_id": "f2k4ceX4raTQAgpGE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teacher in c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n all t : Teacher | some Groups.Group.t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "anrLEMjJCjdCNtSYH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 22:08:54"} {"_id": "CW6MkHnDGAPM5EocA", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c in c.Student->c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oF8vbFTA4ovZv9z45", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:24:22"} {"_id": "k9QsgrRaCjGLyKJwK", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pP7KSRuZLtYkCfiAr", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:19:46"} {"_id": "B42qKqg5NgvRxJocw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "76qfAmd55kiYrJcm6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:43:44"} {"_id": "GYbHvrgLTAixoqiFK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).(~(Teaches :> Teacher)) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iR5AsK8DrFeckd86n", "msg": ":> is irrelevant because the result is always empty.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:34:34"} {"_id": "deyTTsMLSwG2ZSqAM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "cjjBLAPzdhSaj9Dus", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 22:05:11"} {"_id": "dxz7FsNwFSWgrMv7k", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~Teaches.Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qt3KeWthFgKNjN465", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:44:26"} {"_id": "rGwGsT4ZgAAb7cwsX", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3WmxtL7qAkh8zYTWo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 15:55:30"} {"_id": "dpmyus5iWautwfLG7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "76EDtenRRTJzmpGe9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:34"} {"_id": "Sery2apcYDb4WFtJd", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~Teaches . Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zoKCTKuxXMPueTgY2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:32:48"} {"_id": "CKk9t2CzG5GwsyKHH", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher | some c.Groups implies t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h7rsE2tiqCpAMzZr3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:42:15"} {"_id": "kWkdbeyP75FiMcy7C", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.^Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S6CbzWguPTAJPv5QE", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:57:22"} {"_id": "bwk9xhxJJjxND2z3s", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student | Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dmbR39YkX7baJpPTt", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:18:15"} {"_id": "WdjkZu7sgB84PnaHQ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 18:52:21"} {"_id": "umRpAjyDMTqiNwFzE", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | #c.Teacher.Groups > 0 => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NfCE47df3ncjzTaeY", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:38:29"} {"_id": "X8kbjKRKKdRnd3gGA", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c not in Teacher.Teaches => not c.Groups\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z8iub882zzCnzxD38", "msg": "This expression failed to be typechecked line 105, column 50, filename=/tmp/alloy_heredoc3461655846280862079.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 19:01:49"} {"_id": "iBCsxWHnwz84RmCRv", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: p . (^ Tutors)\n}", "derivationOf": "ZCnzPQeLRCxmypR3L", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:56:19"} {"_id": "iYhwQ5bcyCwdFuTZT", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XG62iBhGcfhPsYEeD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 10:32:07"} {"_id": "XEnoywqhsiXMtmWr5", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zwAhh5ngKBdGnS4GA", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:16:45"} {"_id": "aiwadPmpeipNxvrrF", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n some ^Tutors.Person & Teacher\n}", "derivationOf": "2N8aqGM9tTBHYz6zZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:08:39"} {"_id": "3Ru64ZSJQLQRubZLv", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnot Student & not Teacher = none\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WT3jTb6H6Qx6cCZTY", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:18"} {"_id": "tLmuzGNWvD2mitie4", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3EBuqzba3wQWEqSvS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 19:23:40"} {"_id": "kh6b3CtCyDGFrvbYK", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { some Class.Person\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m4iwvjGvxwC3fWN84", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:42:35"} {"_id": "3vgRqX2uNC24c6FBX", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 444, "y": 159.2}, "Class1": {"x": 222, "y": 238.79999999999998}, "Class2": {"x": 0, "y": 0}, "Group0": {"x": 222, "y": 318.4}, "Group1": {"x": 444, "y": 318.4}, "Group2": {"x": 666, "y": 318.4}, "Person0": {"x": 444, "y": 238.79999999999998}, "Person1": {"x": 444, "y": 79.6}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-15 22:41:14"} {"_id": "Cg2hPe5vjf4poriS7", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yJDdaKzDYTp2kytHc", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:50:31"} {"_id": "GtbBuNwiWnpFibzKY", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p1:Person, p2:Person | p1 in Tutors.Person implies p1 in Teacher && p2 in Tutors implies p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "GX9qCNnCSuE448u7a", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-9 15:48:35"} {"_id": "rce9tRTzwwdMHXbNa", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| some (Teaches.c & Teacher) implies some g:Group, p:Person | c->p->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "GZ638wBFfaHn8Cm38", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:22:08"} {"_id": "vECMZq8QfCoZQtiwy", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s.c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "w4iiu5pxz4f2ik29g", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:54:00"} {"_id": "4xmu887dngfZqpmHt", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n4GTv7PJs7jx8PdaB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:04:17"} {"_id": "avnAW4sDuQKDaZkFm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zKeBAZ9JCuzyeEFyi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:19:02"} {"_id": "hMMqGD5gRhMxp4YvM", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Person.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9FExXDTwDtpc9a6SY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:24:37"} {"_id": "quEEfotuR4rScEYvT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HdYsYxzfz4PScKT3c", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 01:44:26"} {"_id": "JqPmcLonGAZTqu43r", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3aANzhCtE8EpAWcEW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:10:13"} {"_id": "BgADKchMPqNBktzK5", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Person, c : Class | some s.(c.Groups) implies (Teaches.c in Tutors.s )\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qupECESG6vpNsJupq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:29:11"} {"_id": "JA8Hy3Djs7cmDodyf", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher\n \tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jMntp8tcurwWcedPX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:09:23"} {"_id": "mQYk6JHmbYncGjN8c", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vfAnFcAzciWkGAdrL", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:23:45"} {"_id": "7SxNB2zgoZ5aKb7Pc", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | lone (c.Groups).(Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YbvvXEMot9i2hw867", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 20:10:33"} {"_id": "B2BvQXTsyaYfixwXp", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches in Class \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d8Tr5kf4nQac2vXpY", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:37:48"} {"_id": "y9JMgEzufeo3iYGQr", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Person, c : Class | some p.(c.Groups) implies Teaches.c in Tutors.p\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dYJMHfgwpdRvfhn5y", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-2 17:37:54"} {"_id": "RuWxxzdvJLB32BneK", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "Bu2RbxhCFxkFEj2bf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:05:40"} {"_id": "xJA4kKxRjPy6uCQSs", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | t.Teaches some Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XRnQuraGBLLdBDtLL", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:51:33"} {"_id": "rK3tDGMzwaWfbzEZw", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Group - Student.(c.Groups)) + Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "G9jcxw96RzWGA9hyF", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group, this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:52:19"} {"_id": "GjdaypKExfP7GvZmz", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in (Teaches.c & Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PyFDCysfuWxWv7tKX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:27:51"} {"_id": "2xv9ApQ66H8NKfQTb", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Teacher in Person.^Tutor\n}", "derivationOf": "4saoQbGzpkbqrr6N7", "msg": "The name \"Tutor\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-10 23:09:36"} {"_id": "tER4HMX2rgXioFAxv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "WmfLyGjBvdn58kyNp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-9 15:21:26"} {"_id": "EKfnad49YJwvfDHiP", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \tall c:Class,g:Group | some t:Teacher,s:Student | s in c.Groups.g implies t->c in Teaches and t->g in c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sHEph8LfC8jC7mep4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:49:56"} {"_id": "8FL7KW8kYoh2G46tG", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson in Student in Teacher\n}\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8EEaYzcNugSnXEZ5E", "msg": "There are 5 possible tokens that can appear here:\nenum fun let open pred", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:40:02"} {"_id": "pAj9CHeEjTc39hCND", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some c.s.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fBMp8wZdDkFqTguQC", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:26:38"} {"_id": "RH44uvktJ4sF86B2B", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "ngfHQwBoccJkyxkq3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:30:48"} {"_id": "2qEDEW7Y4QpPM54C5", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | not (some Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "L2kZnh3t6JRWrfcG2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:59:41"} {"_id": "vjZFzQ39fL6vodKjj", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c:Class | (some c.Groups iff some c.~Teaches )\n \n \t \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | all g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KarvkqrWcPy7jEbEa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 04:11:56"} {"_id": "frjGumfLYmZ65QJwJ", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | (Teaches.c).c.Groups in (Person.(c.Groups))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RHYx7agoEjgzkFz2t", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Teaches) . c (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:28:37"} {"_id": "WMdBwdaamGXuoyXef", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (Tutors.(c.Groups.Group) in (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DjyeMktaN2pnNdW27", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:11:19"} {"_id": "5vep5YSsJdY3YkYBG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n lone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JQXyHL8NzmM3fW7Sx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:29:01"} {"_id": "tSNZp8PK4kTgR4ZaT", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EJByffBAKocgye2eF", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:57"} {"_id": "HcKokf83TvNLAfFNo", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | Teacher in Teaches.c\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9nv3w89Hug4mCktCx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 18:22:04"} {"_id": "wYMF8WTbsnAvyD32h", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WMcjKAwyJhfbQ2vdo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 19:54:57"} {"_id": "2jvvQ7buGbf8uBLwR", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | c.Groups in (Person ->Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "GRhWFSXmz3pgW4RJ5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:46:50"} {"_id": "JLnvgBkEDtGcBD2n6", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | one Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "262Coay38bsEAK9Ep", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:53:07"} {"_id": "GRhWFSXmz3pgW4RJ5", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | (x,y):c.Groups in c\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "j7CWzw6QW2METkvsJ", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:46:02"} {"_id": "jb4BsETR3aXDpdbkx", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hnHdLMQBfsGpwx7bm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:03:08"} {"_id": "n4GTv7PJs7jx8PdaB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jb4BsETR3aXDpdbkx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 02:04:15"} {"_id": "SJAq9cufJ3sWutczN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "nR86FWvPJ5eXRgBje", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 12:12:13"} {"_id": "BCwLSpgb7rCtSz5mQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in (Teacher & (Teaches . c)) . Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "ACKTjAZ9Md7qHsYEm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:00"} {"_id": "vTbdkeQWqkmFun4HM", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ayPoy4kPiY8AMh8DH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:49:44"} {"_id": "7rRbTPpX8NTBXvJFM", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { one Group.Student\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E6KCx8FJXBS9xs6mP", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 17:20:00"} {"_id": "9Xea5iysfbddNCqPy", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "RcahyPoRqvEubALCn", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:42:06"} {"_id": "YZW2wkLFaYgjjPoKd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) implies some t.(Class.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aarA8dDBcn3CJZ6FL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:55:30"} {"_id": "4hDgd3qmzsvuhysYe", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all c: Class | some c.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Se6vis3cGzgX7GkN3", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 15:32:12"} {"_id": "tx5R8GQxHPxKW7bmA", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Person.(c.Groups) -> Teaches.c) in (Group -> Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3eb8LjXDniqvqf879", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:37:23"} {"_id": "9mJDFSssZaNCF9Bi7", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s:Person | some (^(Tutors.s) & Teacher) \n}", "derivationOf": "9HgYvadiPc3LRLsNW", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:50:23"} {"_id": "6EutPR5rQFMbG2khK", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | one Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GkvTGykndxqG39iDY", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 15:21:03"} {"_id": "g7MHjQKxBPFb3o5pJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ceraHY8bE98agQisw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 13:37:28"} {"_id": "S4ycuxNicSrLZAqKR", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xrmYDddrGMTyEt6Bu", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:12:59"} {"_id": "5PkbMGTSe7SiBNF2G", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall t : Teacher | lone Teaches.t \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FkhYNR7GaeJxhq3eM", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:05:06"} {"_id": "7ymZ8LsMiQyGKb6pT", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 22:41:16"} {"_id": "BBfuRTeZEH3RegxLp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { lone c:Class | c in t.Teaches}\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\t\tall c:Class | lone c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pXyNnKcR4i84XmrHg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-13 17:43:22"} {"_id": "MuGEJeEi7chDRRHRJ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teaches . Class & Teacher)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~Teaches . Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GegRPMabnZFCFJuDn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:28:31"} {"_id": "ebRPqLLJMqZcyvyam", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (^Tutors.p & Teacher) \n}", "derivationOf": "qjsNjJWfMzxoouJEF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:49:30"} {"_id": "jR8snY5KgsTkHpj3K", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttCFXghmFCv97FZFL", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:53:34"} {"_id": "hnu8FBifABExiajpg", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n \t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YE64esFTddzFPN7ye", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:24:36"} {"_id": "qRDCYRzZtWjtaWprk", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ygFBiu3jSy3EPSCi5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 23:44:39"} {"_id": "2pi23j7uJ7BbD3oLW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tno (Class - Teacher.Teaches).Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9rz6BxhZiiaYBbKDg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:31:34"} {"_id": "49H3wT4PciGkuCrGg", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6e7Wr3j6N2wDvnuNZ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:41:34"} {"_id": "zK8rBsqAwbLronbt4", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups->Person | s in Teaches.c\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ifsYAdqrSBxxxotgi", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:27:12"} {"_id": "jN5jnpTtAL5hgepGW", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "w9JjWyTLGGZZ9p8ko", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 10:04:08"} {"_id": "cXukkCEuvQHy4Wcef", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4A8Nb4NFzpQZSwurK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:53:37"} {"_id": "2svSAC8PDumY7o3ct", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tPerson not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mQ49SGegKJYz85Wib", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 15:57:02"} {"_id": "R5ZiR3sSQnf63o8vN", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : c.Groups.Student | #s.Groups > 0\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XvHZxufZoXs5ErQYf", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:06:54"} {"_id": "PDfbBNKS63yvFSf5C", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | t.Teaches.c implies (some Person <: c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "H7DrwsFNF2PscmXv3", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:34:50"} {"_id": "QekTa5B2J9eNj3Kry", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "t2PtawfSKuoZ77dgL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:31:18"} {"_id": "sC2rD5j2BBK2yFZk2", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.*Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fTC6wc8jgv2j9C5bn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:09:41"} {"_id": "tXc7CdcJ9eZJ6EaRx", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches & Groups.Person.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "Aw3bT9gEJsLRfRD6s", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:01:26"} {"_id": "vD5YncgFkrcGvoAcy", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some t:Teacher | if(some c.Groups.Group) then t->c in Teaches else no Class\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AexwC5kCrsvoe5D7p", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-8 19:38:50"} {"_id": "ByWqj38nbhx5CgEjT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pk72yKNBHNriD7XjS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-15 21:10:12"} {"_id": "enGNAWZsbaJMgzEHx", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher->c in Teaches\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JtmjcmEWD7ZHHyCtq", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:12:13"} {"_id": "Mc6D2pocTeXYiB5ph", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson = Student + Teacher and no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tcmLgoh8zxZ7iGuSo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:07:44"} {"_id": "T5kJjs9xKw7dpCvtt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tno (Class - Teacher.Teaches).Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uxKvKByaFqdTvZMRt", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:25:20"} {"_id": "EHreroTTcPxFAyKJt", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.c.Groups)\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "s4bxFzsC9mypMeiSv", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:41:51"} {"_id": "X9coXDosGmL3QD7ra", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeaches in Teacher lone -> Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3t6QvWaQXuKDJZCT6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:02:35"} {"_id": "mcgrrTdoXw4qSkx6Q", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "gaTXBoCGSStvmTbZu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:36:02"} {"_id": "qpPCFbSaoioaTQEWm", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | no c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nGyQL6w4dhGdCsruC", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:59:18"} {"_id": "DJvwr9PsSNXaAZgRd", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n no ((Person-Teacher).Tutors) and no (Tutors -> (Person-Student))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "zuNH5Y98eGbNbZbBf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:29:57"} {"_id": "gKSaiTnrsvXqbvSec", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | t->c not in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "voXL2m4mEidNsMcvh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 12:03:23"} {"_id": "Zw8waeKnDhdoKYMxK", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tkj85Q9Sr82mNkzLL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-2 17:22:16"} {"_id": "gjRtt2qPGdhb5cunp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FSRACKij7283NX52G", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:05:36"} {"_id": "BWtNsjfriY8L6Dw8S", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in ~(Teacher<:Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zcvgDExRtqLB5xPYp", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 14:59:55"} {"_id": "YG7q62W8EKmhJf8f8", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gmr8JK5NrLG79qtNP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 16:06:21"} {"_id": "TfgHXTQtHJqemwKSF", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson & Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mWfPYDQWduQcffSiq", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:55:44"} {"_id": "p7Eeg7eCoDW6sFdz3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) => #(Teaches.c & Teacher) > 0 \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MNYnRYsHhwcGbyEmQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:11:16"} {"_id": "TxEaPFcF5XQTe8Zm3", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some c:Class | t <: Teaches.c implies (some Person <: c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TGhu3Z3KP4x78bMXs", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 17:27:07"} {"_id": "jNFSzHiDDFFgYwaS6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Lvx2gkJwbEdBvFitj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 16:06:27"} {"_id": "TtKm42oLDKj3Nezob", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c:Class | all s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies ( some Teacher <:Teaches.c ) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "cpnXFequXq6WLcw7D", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 19:10:10"} {"_id": "RksEWRxixABCNGfhv", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tno some Teaches.Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Tt67q86cth2azLS8n", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:38:51"} {"_id": "Wv99SvsygZPD4q2Kt", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZPJcguiooCmb4Bnqp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:49:57"} {"_id": "PJDmcGH3w7BNRuE3e", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tone Student - Teacher & Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHtgm7t46Hyi3eMbR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:53:18"} {"_id": "u2wDpBctjZw8WKXde", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) <=> (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n\tall c : Class, s : c.Groups.Student | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E6wpXHPygWFzLqE3g", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:35:39"} {"_id": "qxmqat3yW36BjGRtz", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | #Student.c.Groups > 0\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N6yNCFXgLPmkeAcTx", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:54:45"} {"_id": "ASWBzESLTWkZMXmJi", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall disj c: Class | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors.Person & Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BWpBSwSAy3CG77sLY", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:29:28"} {"_id": "LigKndo9HCTA6EdBJ", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in Teacher && p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CC7mHtXzy6FzrWng8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:39:20"} {"_id": "jZz6nfGZDkmhBZkTA", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher in lone Teaches.Teacher\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "Fjk8DRAQZdv9Pp67S", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 10:13:13"} {"_id": "7w86LtpysY4JcWWJL", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "GgtovYWTdgDZYnLnM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:38"} {"_id": "yfimc2znAfeTzqRDm", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aSnFa3neDFpDtJkuT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:05:36"} {"_id": "ZxuHxBWE7xQ7f2eJn", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Person)\n \n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kNfSPHJb5WH6ubCoT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:42:10"} {"_id": "9nxtqmv8sRe5yEdJy", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | Student in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5fhEc2tB2q3LRXaNr", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:17:55"} {"_id": "7saHC65CceCQHjJHr", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some ~Teacher.(c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Fs6CJuEWmpm4BvTe4", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:55:36"} {"_id": "Z6ZjpaSwFmqDWDWYD", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teacher Teaches.c implies (Tutors.s in ( Teacher & Teaches.c)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qCZDoiBhQQQERLaKf", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:35:32"} {"_id": "wbAefYAWfN9kgv5mQ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (c.Groups) implies True\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "pE2PGHEsJoxdQdiRx", "msg": "The name \"True\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 09:54:19"} {"_id": "7gHYHzqFGhRsnc7bX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rubyjizXRqvbwv6yn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:41:25"} {"_id": "7noo3E2SRMJpzyBYu", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "KnEpqTp7P7jSEStuD", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:11"} {"_id": "49xvpin5SycZEqS7J", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p.Teaches = none and p.Tutors=none\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SBmgRnrXKRL8ifZWR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:07:44"} {"_id": "2fnt32ozy5BMzJ6hM", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fxQwSgbLTGZWgepdq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:31:35"} {"_id": "W2y2AdmRsX7QLTYHk", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GFYvdbq3jkRChgEJQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:12:31"} {"_id": "RcahyPoRqvEubALCn", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.(Class.Groups.Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "ZGq26zJwdKx9yM6XQ", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class . (this/Class <: Groups) . this/Group (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:41:38"} {"_id": "CpNETGjDGBh9LQLRH", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "psKpepqMFWPawKviX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:50:03"} {"_id": "8Nk4Zz9TjxXeJW9t2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some t:Teacher | t in Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t1,t2:Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some g:Group | s->g in c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n \n \tall c:Class,g:Group | some t:Teacher | some c.Groups.g implies t->c in Teaches and t->g in c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ku69EWMRe7wfG2nr6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-8 19:46:32"} {"_id": "LBYGuh7yDtZfncmQE", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,t:Teacher | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vhnQm2jcoMBwJ7eew", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 22:00:45"} {"_id": "9AM5vE37RQrYGJRD3", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t->Class in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d8gzFHuxL8CudHQE9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:36:56"} {"_id": "gP955NN7S43Ce5Wsb", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tsome Class in ~Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ntdga9CFohr8WCj5a", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:01:47"} {"_id": "xPuEJWhhpCzebTy6i", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups => (some t : Teacher | t->c in Teaches)\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p, p1 : Person | p->p1 in Tutors implies (p in Teacher and p1 in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c : Class, p : c.Groups, t : Teacher->c | t->p in Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7q6hTKpDQ8a8q3bue", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:28:48"} {"_id": "mgr5fbz53WPZZxRnt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some Teaches.c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "mhucnkaW9nMPtm7Rh", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 09:48:59"} {"_id": "zju9d4zDf3Ecw85Mo", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ygv8YdA7R7JrqL4jx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:44:22"} {"_id": "CKW88ST7NskWD8o8H", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - Student - Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:34:03"} {"_id": "L5rNjwWhguWHCPg7G", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tStudent in Teacher.Tutors and Teacher in Tutors.Person\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hZETk564CJFLn6TnE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:24:20"} {"_id": "ppNGxGaD3SYjqpKsL", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t Teacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "M7LtSz3DEjsuyrNza", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:40:41"} {"_id": "x4b8Rx9s7oLjyJryd", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Students and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u4yoNhYxZCEBdCWhq", "msg": "The name \"Students\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 17:59:53"} {"_id": "2dsoyqgL839B6Zfin", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c.Person.Groups.Group\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uTYpXkGhk6WkK6Dtf", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 22:01:19"} {"_id": "9KGWu9oPZbcFG9zM5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r5rsDcenSWqmvjtMW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:22:07"} {"_id": "TEtebr5Nr96TFsjvf", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n all c : Class | all s: Student | s<:c.Groups in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p6GXSzFZ4GKDA3Ltm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 18:41:02"} {"_id": "bXDpd4bfDNZhFtbpW", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n (Class -> Person).Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "XXzgApZiQcH3hTEcx", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 12:25:44"} {"_id": "72uZM9cyiqX2SF6XQ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vLQ6mmH23X6DdjdsW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:37:43"} {"_id": "DEisywWpu7ZCvfLu9", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | Teacher.^Tutors.p\n}", "derivationOf": "DkMrykuvZ5348bhqB", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is p (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:32:14"} {"_id": "pbGBsiEkZbji7HTxR", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZruT3XcHNTehe322b", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:26:07"} {"_id": "km7mtnWgPTTwRHnDS", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no Groups.(s->g) & Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6FggudsHWcvSeLdMo", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:25:31"} {"_id": "ELR79aHsqGWmdvYwb", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QgEzarmMXKB6nj6EN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:22:28"} {"_id": "opFYdj9ni8aogEhZh", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups implies t.Teaches = c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nq3Mq5M82FgadM9pW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:49:19"} {"_id": "wAWJgswXMguqbsn6f", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s:Student, c:class, t:Teacher | some g:Group c->s->g in Groups and t->c in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X5buGMY2e7uTwxy7Q", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:25:28"} {"_id": "YxK6np43wAqna7PMF", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "LSJupPa9CqpkSJX6W", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 01:43:31"} {"_id": "aAYDykTQXN52MFQsi", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | some c: Class | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8sNs7zmyZGrociZCC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:11:25"} {"_id": "K2Wvm99TbgnyWivqF", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | (t->c in Teaches) => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\tall c : Class, s : Student, t : Teaches.c | some g : Group | s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qDqyHEAPNETxipogh", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 11:58:16"} {"_id": "SpBwhWvMmCK8NCcLN", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n Class . Groups . Group = Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BZ9YgKE4eMzqHkacS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:18"} {"_id": "MrWtWGtqmNTPQGTqT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | lone ((Person - c.Groups.Group) + (Teacher & Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3q38PMXtGCryQaWoe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:50:32"} {"_id": "LgQiWMncTqDC5vou6", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, | Teacher->c not in Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "swADhDAty2QCrkakH", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:54:26"} {"_id": "jZuB98AL7QHErdwvy", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZxQt5ZyJqtALz9TJ8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:38:00"} {"_id": "3EBuqzba3wQWEqSvS", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "45Dgvq2S9EWKd8qqz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:23:36"} {"_id": "X6q8N9atJ4XWnLj5e", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t:Teacher | some t.teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tSQ8hibiAuQ9EiNYv", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:02:15"} {"_id": "P9t3dRm7wgoAnKSSK", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups < Group) = (Class -> Student)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "n2NBdmApMJ9BZtPoP", "msg": "This must be an integer expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:56:23"} {"_id": "EkYuBJmofsNa538fd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8AjQtoaqrt98Y9BtY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:08:42"} {"_id": "6KsS9d5NkWmDoPcDS", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p : Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno p : Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a2fKLsQXmj7TDzFvc", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-11 11:34:12"} {"_id": "HswJcmBwm2aNLYnQx", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (Tutors.t & Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "DzHYv2oC92cbPrbwW", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 10:01:50"} {"_id": "Gu5iTQrErY7fcDznk", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | some Student.c.Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7Rjvab8vnhipJQkZ2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 21:13:28"} {"_id": "dyBtbWcvjsnzhHdyb", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n all s : Student | all c : Class | some (s.(c.Groups))\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "CRpeJmDtoGzzW6pw3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 23:47:02"} {"_id": "Sz45AReFtTf5LfYFB", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nPerson.Tutors in Student and Tutors.Person in Teacher\n} \n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i85kmYxD3yaBzP3FZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-19 20:21:14"} {"_id": "jWC2DbNTDAaug5jBH", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "wqKQvXHinPw5XJvmM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:43:26"} {"_id": "Lzvfn8u4mmsvBcsg2", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Teacher.Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kKgDARv2WbnaEfAn8", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:17:28"} {"_id": "iDR9cRYgJcwbPzowB", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n ~(Student<:Class.Groups).(Student<:Class.Groups) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fm5geSHmbqib39dd9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:51:34"} {"_id": "HorqXGZc4wgP3YPnj", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wfu4tMXyEhFmBt772", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:51:02"} {"_id": "GFCNvjPw3LjQepp5R", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "izMM8Cjro6cZQ8xCX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:53:47"} {"_id": "H6663BzTMWzJPC5K2", "cmd_i": 9, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | (Student.(c.Groups) & Groups) = Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "BBbeF5diou8nxBQvE", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:41:24"} {"_id": "v23ri8qgFzJPJNLSZ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uGC9toPAzLcKg6549", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:48:57"} {"_id": "9McX5mA4S3pZ3DNR9", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYQfBWQt7spLhTX7H", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:44:45"} {"_id": "HrDxhgvx6Lh7fcGY4", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uWA96w2WRBy46cr9F", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:19:58"} {"_id": "3kXzyvNzymBN5QrxN", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NSteqwtzt7hJiS6xq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 14:47:18"} {"_id": "vYfY6pcgvJwSv3rWP", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n ~((Groups.Group):>Teacher) in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JuPSaKExYb6tdZiLR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:53:11"} {"_id": "nhsyRKN4h2dSec5t9", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ro9FKwKxjQc2XeD5E", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 23:01:31"} {"_id": "LojrHoXWN5N6Kkc7w", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vc4n7XBvSo2Hnt4Au", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:41"} {"_id": "2Pej7phAxbTjbZGRB", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no (Person-Teacher-Student)\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\nall c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\nrun inv9", "derivationOf": "P6xhATpy3zd8fn7ed", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:22:38"} {"_id": "82bvz7wuAW6yzTqLB", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | not (p not in Teacher && p not in Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LigKndo9HCTA6EdBJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:39:57"} {"_id": "ibza3ZoLnTGAx3233", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:37:16"} {"_id": "oe4o8mmJDvvatQCy6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NH3GZ9fYxPgedgsh3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:17:05"} {"_id": "hG5RzHjnScfa98vxy", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c3TiJZJBWhatjZLet", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:38:38"} {"_id": "2Lxj3523dg64qGYyG", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "gnrWoRMgXGQPrJ3xi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:57:52"} {"_id": "ziA3MrqhQwtJrhaXX", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "grnvizXyS7waoRYtm", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 206.83203125, "y": 199}, "Class1": {"x": 413.6640625, "y": 199}, "Class2": {"x": 620.49609375, "y": 199}, "Group0": {"x": 206.83203125, "y": 298.5}, "Group1": {"x": 413.6640625, "y": 298.5}, "Group2": {"x": 620.49609375, "y": 298.5}, "Person": {"x": 413.6640625, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-14 23:10:21"} {"_id": "eLqLpKpJJnX9XPuu9", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "isoJc628juTtKGguj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:37:28"} {"_id": "GvkLmLLor9dY2AxKw", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (Teacher in ~Teaches.Teaches)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9K3r4vqqjWHsDGb9L", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:38:26"} {"_id": "Skb3EvNWQczxGLnGo", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pBunak3Barofb5LY5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:23:53"} {"_id": "fhBrxtfi46k5wMGAd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some Teaches.c & Teacher) and c.Groups in Person -> Group\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JMwnktTEzudDjPuxw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:42:35"} {"_id": "e4s44RKQuzi3yRbnn", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person |some g:Group | all t:Teacher | t-> Groups.(p,g) in Teaches implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "pn8NWqHuDSFfoa5v2", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:34:27"} {"_id": "j7ujvRSkMJJn7wPkc", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "njxaZCZy3oD4eoFPp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:59:16"} {"_id": "JJ3nm7NAw7DBiTsWD", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| some (Teaches.c & Teacher) and some g:Group, p:Person | c->p->g in Groups\n\t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "2w6uKJqxDKoENfiG7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:23:27"} {"_id": "e4zSh5XR9uTZ3kzYm", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "svMmGkDTRXGn35GRh", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:47:37"} {"_id": "ZdYKzpa2ja2vujyc8", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:07:19"} {"_id": "kBsBGaRhjxBhETCt4", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n all t : Teacher | some t.Teaches\n\n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "sJNK8CdpHGeSAHNSi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 19:14:44"} {"_id": "kLt47MvrBY9xtYH5T", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y5NidfDJzEMRmo7Xg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:36:03"} {"_id": "DCPe5ph5cHcDiTGMd", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall c:Class | some c.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "y5M688qn8SfrpojRt", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:18:17"} {"_id": "3bLp27QwiqinyZvJs", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student - Teacher) & (Teacher - Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QughbgnCbFFTZvLvC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:54:15"} {"_id": "xFPZdXQB328C3zuhS", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Group & Student \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZTJgmkXzz9KmavrTG", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:21"} {"_id": "3DvehQ2fTn2BoiCBS", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher -> Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c: Class, p: Student & c.Groups.Group, t: Teacher & Teaches.c | p -> t in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3pNGk8nyynyE3tEgA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:13:11"} {"_id": "5MBX4pFGeHjfD5Bkg", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "SL8E7EuSRfmErY5QK", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:39:39"} {"_id": "KgwLK6muh4Zmz992z", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher.Person\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wihxzrQRSBnTM8x7L", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:36:06"} {"_id": "jKNDzchCBhxwiu77K", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tno (Person - Teacher).Teaches.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eAJ7RPEqW4gZBN6kz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 15:53:39"} {"_id": "t93GjpAezqzLxftWy", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "P5NQYgiy86dmzk7Sj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:55:39"} {"_id": "DiosfWdiJ5aTFW5bg", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cW2aAgZmLRrEjrm58", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:29:31"} {"_id": "zyjCBKwiG3Yxq7xTR", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { ~Groups.Class implies ~Class.Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EXSbLgYY8ry7yfSHs", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 23:01:26"} {"_id": "k5nvNhDqjDxHy8ceM", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, t : Teacher | t->c in Teaches => (all s : Student | c->s->Group in Groups => s in t.(Tutors :> Student)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "Hh4r2hgbGDaSkL4oo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 00:32:27"} {"_id": "DzHYv2oC92cbPrbwW", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some (Teaches.c & t) implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some ^Tutors.s & Teacher\n}", "derivationOf": "t2Ap6sjEq7nHP3gwp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 10:00:55"} {"_id": "aSk3mzybAXwKn4MJ6", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^Tutors) \n}", "derivationOf": "btxRsv5bY8fv6LK2N", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:56:03"} {"_id": "S8bwMCFsyHvj6Ma3f", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher.Teaches in Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ubf7EidMH8oYHX4HP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:56:53"} {"_id": "3ffipLgbi4xpemLyD", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | no (t.Teaches - Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ShnfzBQdPoJjjXMrs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:54:55"} {"_id": "5sxSecaaH2GqtFp2z", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bvfvYGfy8BLrBNSQN", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-7 19:41:52"} {"_id": "8iY8nK7DKbHz2Z5EM", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | lone t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EmfuEHATF8W4zzFfS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 12:32:19"} {"_id": "jEtMMP39hnWJmbKBk", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student.(c.Groups) in Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "C3expcfyzH73dgqSm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:28:50"} {"_id": "vSoFwcmjuZ6hafYgR", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teacher & Teaches.c implies some Tutors.s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rS5X74dtPPPdZmZ72", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:27:59"} {"_id": "9nMZ3ccecNE7mArZf", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Person -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uGrpGe8nAm2ay7wXy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:55:26"} {"_id": "jPZMEDNiDze3fxCYk", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6pRdcd23j3R7WpSiP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:15:16"} {"_id": "CJYwg3PNd3cR8d4hv", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches and some t.(Class.Groups) \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SJDuLLsdS6K6hHNa9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 19:09:28"} {"_id": "kFCaiPssWP4Z49bZM", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (c.Groups in Teacher.Teaches.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gm9zQmxPZfz888mKS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:19:08"} {"_id": "q2PsHRJgFsLFMDTwL", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ((t.Teaches) & ((Groups.Person).Group))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "NDWqeiTsuN6JPt7s2", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:05:40"} {"_id": "q6Jx2E9fiMMFhmcPW", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person-Teacher) and (Person\\Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "e65vfBE5RET5EW2oB", "msg": "Syntax error at the \\ character. HEX: \\u5c)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 20:49:53"} {"_id": "ZkMxrjxP3oxYgb7am", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xeLmj7hng4hi7t96h", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 13:46:28"} {"_id": "WAWFBGvT76NQpjDPW", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutors in Student\n \tTutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aP7wrXuT8M5DEzspv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:46:39"} {"_id": "fMEFexPNmFXCnnkA8", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher", "derivationOf": "SahRJR7A6tw6M3iMi", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 21:18:56"} {"_id": "LZqQfY88zDeNGNSJ6", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tClass.(Teacher<:Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tStudent in Class.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m62h6dgptosA2SJCo", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:46:40"} {"_id": "hD7tjdCrpfefA7XBh", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "7m2dhAAfGeQ6Td2MX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-9 15:54:08"} {"_id": "uTYpXkGhk6WkK6Dtf", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no Teaches.c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ap7reSv9WmFByTjGS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:59:52"} {"_id": "KxMiNciviL2S9SDNN", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5ch8jgQNopB24jnKK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:32:14"} {"_id": "rYKr3xRercvz4REGX", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | t in (Class.Groups.Group & t.Teaches)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PHrkmugzq9htyXHB3", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:48:46"} {"_id": "ghx4C6ZhzuGTrXh5A", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~Teaches.Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j9Gx9zJ8y46ubC9yq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:26:32"} {"_id": "cHbyNcE8AyK9dHqyA", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | ~(p in Student and p in Teacher) \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6RX8Bom2KgbnwXYT2", "msg": "This expression failed to be typechecked line 55, column 17, filename=/tmp/alloy_heredoc16941971488486556543.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:48:53"} {"_id": "6LXwQZKMWvqN9mLWq", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t -> c in Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c : Class | lone Teacher -> c in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jWSDNvq25HwiZ2YiN", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:51:35"} {"_id": "64TsGt2Nw35YFr4Jx", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W2hPAKHiiHKipc63D", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 17:53:05"} {"_id": "f9W3oDKyTee6qdyij", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~(Teaches<:Class).(Teaches<:Class) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pS7arGTYgs2ami8oY", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:45:30"} {"_id": "SC8ETMECK4jzdHvgv", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \t\n some c : Class | Teaches.c in Teacher \n \t\t\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \t all t : Teacher | some t.Teaches\n\n \n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "h76ws9XMoW4vYfJGR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 19:27:01"} {"_id": "NyPe6AMN3jB26HWnY", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uGkzvbgqdTecBh6LT", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:42:28"} {"_id": "x58wcB3D7aKRqRKxC", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | (Teacher + Student) c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ERPMB3SdxagNX5WLC", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 21:59:11"} {"_id": "uBwKaPJGD9piQSwsx", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jcuG8wRu5sjLgnmGY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:01:24"} {"_id": "YRMEBcGSd2acTD3mM", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c :Class | (some c.Groups) implies some (c.~Teaches & Teacher)\n\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.tutors\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bYXZ7FiLfJ6hXipgK", "msg": "The name \"tutors\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 18:36:41"} {"_id": "nHvqWDPsFhvfqfchp", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher = Person.Tutors and Person.Tutors = Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ttgGmocWvLdPFDuNM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 19:25:14"} {"_id": "kPEMdZrykjGZDKEcw", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches in Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xLXhfJiYgef7Dgwb9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:07:02"} {"_id": "6y6oxz98epMnDW2FX", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c.Class,s:Student | s.Group :> c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p4FRwfbjQFJHsju4H", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:22:57"} {"_id": "cg3L6bwqC7zfehFoG", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Student + Teacher\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ywSKjp3dNvEzrtkmv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:57:50"} {"_id": "6qDfwr5tmH9ht4FXb", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PxrWQSP8ZDWsBgtZ9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:23:03"} {"_id": "R2YXuPWbz55ngvPNF", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some c.(s.Groups) and some Teaches.c implies t.Tutors in Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BFgkiPCgG8qBgnTGT", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:24:44"} {"_id": "EJ37dz7WXNnu6jxzE", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | one g : c.Groups | p in Student implies p->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NkRz2EhBZuLgDxQgb", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:15:16"} {"_id": "FW7fKv9xbFsGpmk8H", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n ((Class . Groups) . Group) = Student\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SpBwhWvMmCK8NCcLN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:15:32"} {"_id": "3oGufb9w3riAfijXQ", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 20:54:07"} {"_id": "obt5PdAks5ZLnru4M", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rLFLmMECTys284uBY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 15:58:08"} {"_id": "xQJmdSrWB6GiKya3L", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tnot (no (Person & Student) & no(Person & Teacher) )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "znhLXhbYD6FTfqPZZ", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:36:41"} {"_id": "qdyLuMFK46yCroaR8", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Teaches . Class = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "24Bsffg6bBgRFrKmZ", "msg": "== is redundant, because the left and right expressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 09:45:34"} {"_id": "T5Wb4DyXkKN4wrDQC", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | c <: Groups :> Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "S3qr9RQi29hWpWDRe", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:00:25"} {"_id": "E43vukgS2oE3vhj4p", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xW6QGexg67snqqWwP", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:03:19"} {"_id": "34YKqLp28HsfvSJSa", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = not (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yfimc2znAfeTzqRDm", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:06:13"} {"_id": "9hGCdfprsysZPAmNY", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x6FvfjHtk9byCMdyz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:21:43"} {"_id": "7AHisJms22RsASrtG", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | one t.teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cZRk9Q3m7jnwdDGMg", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 19:57:36"} {"_id": "fu7JA2iydifzzoCza", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SKQePC9WW6HYoRbK3", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:49:28"} {"_id": "pb5R9tYFvAjPc3Nwf", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher or Person in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xCkd83v4siDmPwDxm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 12:17:16"} {"_id": "3xtQSM7Cu6oq6F6eB", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | no Teacher.(c.Groups)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kw2pS6b9YL49ewMen", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:43:13"} {"_id": "njxaZCZy3oD4eoFPp", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "b5MkH7DtDptJ32ykq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 14:59:13"} {"_id": "M3B3nNPDmondYjsJ3", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D3k5Nhzy8PtjrKLws", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 17:57:32"} {"_id": "sBzPSHuqHKiz58k2w", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "X6bxTHCGbqXLtmmpL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:21:10"} {"_id": "gTwzLC2uH89yNfmeL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups iff c in Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rzzi3p34XRryDepoy", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:59:57"} {"_id": "WfyXJsYbSjNSbsZE7", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \t\n \tsome Student.Class.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NtHqvntNP95rHfN7L", "msg": "This cannot be a legal relational join where\nleft hand side is this/Student (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 18:16:09"} {"_id": "Bt8eqf4c2d237cCPq", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | Teacher->c not in Teaches \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LgQiWMncTqDC5vou6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:54:35"} {"_id": "3QMBWJEPF547hJBpP", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "withbSMoLmv4Wb9MY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-7 23:16:28"} {"_id": "9LghhFPQF75adi6Qb", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kjTrqaakyHupfKzYw", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}]}, "nodePositions": {"Class": {"x": 444, "y": 265.3333333333333}, "Group": {"x": 592, "y": 132.66666666666666}, "Person": {"x": 296, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 10:53:05"} {"_id": "rS5X74dtPPPdZmZ72", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some s.(c.Groups) and some Teacher & Teaches.c implies some t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XmigtMQhHzR8zKX2i", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:27:46"} {"_id": "967FpRoekDmsbd2Pv", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher = Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RnDnYogc9vW24cd7d", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:28:19"} {"_id": "xi5Rq9uxGyPx8ghAk", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teaches.c implies (Tutors.s in ( Teacher & Teaches.c))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RPracLiXBxhHhScK8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:32:11"} {"_id": "zrNW8LBLq5L9G4sGA", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { Person in (Teacher or Student) \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in (Teacher or Student) \n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P5ZnJBML2RXv2gKoj", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:47:50"} {"_id": "4CJiPWveNtz9BrnQr", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "6tX6NhxHCi9X2MG42", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:46:36"} {"_id": "oLuiY34C4ersCHxNz", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cckZ6tAfk4RWFKt7F", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 09:29:28"} {"_id": "SPuRmzD7rZxgS8bmp", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 10:10:04"} {"_id": "eGYsmWENbZYwz3zwo", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (no c.Groups) + Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KaYJ9SjCn7w7DSJ7e", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:50:51"} {"_id": "xMcJpNXZMATN36www", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EAecDCpPWQEWczHeS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-10 15:32:13"} {"_id": "brE8kzYojZaxMivAi", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ARHDp9J7LeWkhwg2s", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:40:21"} {"_id": "4qQfQNPXMYNx5Fokp", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n ~Teaches.Teaches in iden\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "h4QgDkbA6NSTpHDvc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:39:39"} {"_id": "dZmmpDKzwfSA3Cjun", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t lone Class in Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MZQEevce98mhooXxn", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:44:38"} {"_id": "RcWmzvr5fFtTyPEww", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some c.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "FKkqseBudtKLSTmhd", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-9 15:20:56"} {"_id": "e9EXfNPzNdKF5vQH3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class<:Groups) implies some Class.(Teacher<:Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9yhGMCZHiN9oZupcJ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:19:22"} {"_id": "q2pK5mAnbScDSJon3", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n all t : Teacher | some t.Teaches\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "46S7BYrZnGBhS4H6f", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 19:09:14"} {"_id": "E4HfMidxv4xrXor4a", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KvAtenEL9XPManvME", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:25:30"} {"_id": "asGu3aG2QNBNoCXpB", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZpzfhzMM4NzrTMHzA", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:54:25"} {"_id": "KbeK5v5chm4bawpDF", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| one Teacher = Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kvC7cehBHjiDrbtWd", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:44:08"} {"_id": "zpopXYeRCByiTgrPu", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4eriHntwbvukYkjbu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:37"} {"_id": "iajhycs2A3f898Smg", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5r4Gfkfvy7mnoKZcg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-13 03:24:45"} {"_id": "WMNfZjLDpMzRyLdg6", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7ibXAZpLit4kPEPD4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-2-24 15:27:32"} {"_id": "43HYKirMKB7FJvwqT", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno p:Person | p in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nno p:Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nno p:Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aq4D6pPQgxJX7xWRY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 09:54:45"} {"_id": "Aw3bT9gEJsLRfRD6s", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches & Groups.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "8DTs5wsyXxnwSwSsk", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:01:03"} {"_id": "4ekph4kAgbS32ZuRX", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t(Person in Student) or (Person in Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xbjhF2EFuNktJvn6L", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:30:37"} {"_id": "AFXXJ3fkA4sJzJZx6", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \t\n some c : Class | c in Teacher.Teaches\n \t\t\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \t all t : Teacher | some t.Teaches\n\n \n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "SC8ETMECK4jzdHvgv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 19:35:35"} {"_id": "wtHvygpHtCNsH3gEf", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XTpgXC5xGnf4BBjvj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:03:35"} {"_id": "EnMDzrM8BsvkaZKiB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CmCgGcNuF3RhDCuqE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:08:20"} {"_id": "9i2uGNzf3Bv8Eh2co", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tsome Student - Teacher + Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3ruWP9YH9q9NjLGB8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:53:30"} {"_id": "JRgRnd94Fh4ufCgcH", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "k7c8n4ugEgBA2h2Ya", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 14:45:11"} {"_id": "XG62iBhGcfhPsYEeD", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oEEr8cXB46FB52z7Q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 10:32:00"} {"_id": "fmpRCHYo6LjuymR95", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "ngp2K4LohPy7rrZbx", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:16:06"} {"_id": "XM3eBJFyuqAG3A8hE", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher && p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "82bvz7wuAW6yzTqLB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:40:32"} {"_id": "rHYJxnasx8bdXhNWX", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n Teacher in ^Tutors.Person\n}", "derivationOf": "GbFQXvaMQnRWDTmFS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:10:31"} {"_id": "DR3fbwkAkCnNRfer8", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Class.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NGq6NWpBuxhrbqZNB", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:58:19"} {"_id": "Ai42ZAkRwm4eEWZiA", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class| some c.Groups implies Teaches.c in Class\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JiAE8yRmoDZuAwiMz", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:48:18"} {"_id": "zMYnPC5wvFn2bWTbB", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some g : Group | t->g in (Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "ujTJZmZ8e4DLDE7jY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:50:17"} {"_id": "oXgt5CgHnzHvHoPbE", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c:Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Khu3jMHs6hp5RPMcJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 17:40:27"} {"_id": "DTyXsM7WpiWeXQTJZ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 13:45:28"} {"_id": "Ls8enoWKzo6tZf8Mw", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | c.groups->s in Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d2qW43o3oDxGbKJkN", "msg": "The name \"groups\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:22:49"} {"_id": "KqKCW38P2uKmv3ckA", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student & Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qnMnrLDq3LM7dc6Dd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:11:23"} {"_id": "uprL3fXcJWYXQvmk9", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Person.(c.Groups) & Teaches.c.c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bZmWHPiz3Xz8tpDbX", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Teaches) . c (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:35:32"} {"_id": "rJ5qYoF6wpf3PDLw5", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher<:Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Teacher:>Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hn6DeuzsYsQmhSsaK", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 21:10:37"} {"_id": "r6idsZiBrhWoKXdFN", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHDkXnT5Ex2nf4NnL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 20:02:44"} {"_id": "CrBGE56LxET2uZxGn", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all s: Student , t:Teacher | t.Tutors in Student and Tutors.s in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JTnBbWKfwaKGsGCpD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 17:40:49"} {"_id": "wFhQzMva4aPMcGk2s", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | p lone in Student or p lone in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FKvkhZY4DqMzWav9d", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 15:00:49"} {"_id": "uXXZ96hZ5bEdnfboG", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | t.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "W7z8rqqcE5W7Qmghr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 20:49:32"} {"_id": "zEtz7ocAZRMziFhZK", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dCS748S6G8nzqRrAy", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-24 10:32:24"} {"_id": "WPoxuvwDwyoWjZq8E", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "coqBHjXGnraYhy2xs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-12 20:33:30"} {"_id": "DzWivgbdHrBNWiC5j", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in ~Teaches.Person\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "niWDEzquwhSQQYj4p", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:29:09"} {"_id": "RPyQ7P2K2xRmap8K6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WfBweHgwFD2qr6ung", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:18:53"} {"_id": "L9kbe9vGn5ftLHwJw", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:18:14"} {"_id": "Qv4eimPsjqW6xN9Av", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some p : Person, g : Group | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d5XDdvggHmt6iiRTw", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 18:28:35"} {"_id": "chuLiyJWPsmRy4cFf", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all disj c: Class, s: Student | one c.Groups[s] \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BqbLPXYGP6NELezxs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:38:21"} {"_id": "8twsQH4udK5q7Fh9m", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ynnrfpHDXZnYWss97", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:35:27"} {"_id": "sXCJ72CFWJ5KJWLQ2", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | some ( Person - c.Groups.Group) + (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oSZcMTZCvhtF43pZ3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:49:02"} {"_id": "gs9j2pnKmRmyu8mRP", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t : Teacher | some t.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3kx9mc74HDzKPk4Mt", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-19 18:11:06"} {"_id": "wKDEw9BHhLd6HA9Qi", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Student in Person\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "E8q4z4wFsFoBEuxoo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 18:17:27"} {"_id": "cQWYj2udiczBWMPpa", "cmd_i": 11, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.Groups.Group.Person in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vpjtjCZnT9eXTtW4k", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 19:55:10"} {"_id": "BRLW4CcGCam5jfBfs", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tPerson not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2svSAC8PDumY7o3ct", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 15:57:05"} {"_id": "8yRmQCujptpw3ruER", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Person)\n}", "derivationOf": "cagS4mivdCrLcqdur", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:14:24"} {"_id": "zCh4a2oyMsF6piihm", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zpopXYeRCByiTgrPu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:40"} {"_id": "u8zuNomjojihqRAwE", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall p : Person | p in Teacher implies some p.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all class : Class | class in Teacher.class\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iR29RyhMiEmwBQwE9", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-19 18:20:05"} {"_id": "hjQNk4WctzrzD2tCy", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "i2X52p76hwQujQmhc", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:17:50"} {"_id": "RuLQ4N2SBCrdJCWET", "cmd_i": 1, "code": "sig Name {}\nsig Adrr {}\nsig Book {\n addr: Name -> Addr\n }\n\npred show {}\nrun show for 3 but 1 Book", "derivationOf": "L6WBWyk2mFukupDwk", "msg": "The name \"Addr\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:26:57"} {"_id": "gquG94JCDbkL6xGgX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wqR4MmaLtSDS3Z6SL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:27:23"} {"_id": "R6F3iwFDipSPhLgWC", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome Teacher & ^~Tutors.Person\n}", "derivationOf": "8S2NkRbjNX4aWowpc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:18:37"} {"_id": "ZRg4Yh3oB9cmhrSCY", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome Teacher in ^Tutors\n}", "derivationOf": "PKzcGBDryS7pCjMFX", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:54:01"} {"_id": "JA3cLC6aY6iiZYyy3", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n ((Class . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oc6cCBurxKxqoCz5X", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:05"} {"_id": "YxT52FZTdaQvXHtwd", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Teaches implies c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yT5n6LkmA3sYHsxXm", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 14:51:43"} {"_id": "jg5jmJQBd6d8sG9AX", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\nPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\nClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\nall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "3GpWaJGKukDsKmHGM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 11:35:04"} {"_id": "X5oGKkkKLhmjH67Mq", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTall Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vzrhAgvnLYSZGK7FD", "msg": "The name \"Tall\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:13:53"} {"_id": "EfaNCHMYYYDKbm9qF", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone t:Teacher | all c:Class | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8nSoLNsBnpWGHqLPY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:04:07"} {"_id": "DyBMtwzKD9QdmtZFh", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlone Teacher in Teaches.Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}\n\n\n\n\n\n\n", "derivationOf": "DXh9FmJPReQgRQBCv", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-19 10:21:54"} {"_id": "2LAqo2izCYi8QwGzb", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Person in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Person in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iRSJiXye5HpAmhnfG", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 17:52:36"} {"_id": "EwgvYWzR5Srh5EQq2", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n \n \n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "3vy9fHYoPPr34wYZ3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:29:43"} {"_id": "WijD8kMrTHRFkwjtv", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n\npred inv5 {\n\tsome c : Class, t : Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher, c, c1 : Class | t->c in Teaches and t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches and t1->c in Teaches => t = t1 \n} \n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | t->c not in Teaches => (some p : Person, g : Group | c->p->g not in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n\npred inv14 {\n \n}\n\n\npred inv15 {\n\tall p : Person | some t : Teacher | p->t in Tutors or p->t in Tutors.Tutors\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:17:49"} {"_id": "kdkgJRJENaz4SRGZg", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n Teaches.(Teacher.Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4rYC9DZvoK9TM34ox", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {univ->univ}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:18"} {"_id": "35uKLrHamCqc7huqW", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nvvrXBqoe93dLHAy5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:02:38"} {"_id": "j7xT9Q65jzrbcfyhz", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tsome t:Teacher |all p:Person | t in p.^Tutors\n}", "derivationOf": "Ebf68TrQiAffmm3B9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 18:45:03"} {"_id": "kkNvrWgo5GodHBHrG", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome c : Class | lone Teaches.c\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dzh56MnSHztgJhGBu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:14:16"} {"_id": "kveSFL638tZQRiPx6", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class, s : Student | s in c.Groups.Group \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8w6PGtZMXpF6XWQHp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 21:18:50"} {"_id": "5bELwdTwEL8PsLQdb", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | c.Groups in c.Student->Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4SCND5uHu2DoiBdgD", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:23:00"} {"_id": "ZxXCb2HxMdpyiGiuo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches <=> (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8foDS43k9wQ8j9mZD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:32:01"} {"_id": "nQswSrqH2dGGnwBDL", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeachers <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "f6HNybZwPFRfocGYW", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-4 16:08:13"} {"_id": "roH5DPqdAxJJiw9dy", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZT2iu68PYi26GMv5Q", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:05:20"} {"_id": "p9PJ84uusvDBM56k7", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TLmwt9oSfNn7ma9EC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:25:28"} {"_id": "Y3u4KnT8mBsbbymKB", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in ~Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YrWG75CMZwfS63fL7", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:27:13"} {"_id": "xxsQFNLW3th4kDC8e", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:01:38"} {"_id": "ENZgyisQ6N2kK6qih", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some (c.Groups) & (Teacher.Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7KPY92RQHdE3GLap6", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:13:19"} {"_id": "gm9NxPKpNuhBgqexJ", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tnot Teacher & not Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ctsc6Er28AagES6Xf", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:09:37"} {"_id": "KphM6wwcGwcTEfLyr", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tno(no (Person & Student) and no (Person & Teacher) )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHTrh2apPuE7BuCcm", "msg": "This expression failed to be typechecked line 60, column 3, filename=/tmp/alloy_heredoc9740693049424715534.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:34:17"} {"_id": "t6kKRoWu7WjZuHgDN", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Person.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oc6BZNZdpeXt8Qy4p", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:10:25"} {"_id": "6wvAEumqFELLHudzv", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pwCzhjC99YHHhArf8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 21:39:46"} {"_id": "Wrwhj6HS2vuvtgroi", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iocdjyAFbf42CE2Gw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 19:58:35"} {"_id": "Q8JMFa93rgRkHH4ky", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher <: Teaches).~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gsgSazrv4Shi44pws", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:21:58"} {"_id": "86vpkvRTzkcjdGmAN", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teacher.Class\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Jct2bAFSEcJrixRi2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:38:36"} {"_id": "A8nprZmhsQrT2nn2Z", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student implies p not in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5cwLZKyn7icfYa7Yu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:34:11"} {"_id": "u7xnQYm9gbqa7AbEX", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t some Student.(Class.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DSWrjNBG4fkbEkBCw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:18:54"} {"_id": "eHYLgNF2ZmZWBBJD2", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "CN3gtbz2JTPKvYCNo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:28"} {"_id": "RPSBTQtof8JaPnr2Y", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "62tkquRsfaSrMbNTC", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 15:47:50"} {"_id": "NxNW8om6Pgr52sQ7A", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class | c.Groups implies Students in Group \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "A2oQQSYkLA3LLFH5h", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 13:31:28"} {"_id": "mwvkuvpadSB4cENKa", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LNEYb7rBNovt6rc2q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:22:14"} {"_id": "8NWF569cWE7QS5TBD", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutors in Student\n \tTutors.Student in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WAWFBGvT76NQpjDPW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:46:45"} {"_id": "m3D6RfYyfPkbbgRa7", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | c.Groups.Group in (Student+Teacher) implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D9PoCbcyGyAGsbEtF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 21:54:48"} {"_id": "JaC2bhnjBoruyosM8", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J9LRXCEmahL32nnLb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:08:46"} {"_id": "BBbeF5diou8nxBQvE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | one (Student.(c.Groups) & Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "KnArwsMApmJKnooDg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:39:20"} {"_id": "5BNWyxcvre79XiwCq", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall p : Person | p in Teacher implies some p.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | c in Teacher.Class\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gbq58TQHJwSubFF8N", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-19 18:29:33"} {"_id": "mXFzxrSQtX8pg4RWk", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some Class.t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RC9YL6MqNjs3gRxY3", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is t (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:00:32"} {"_id": "wXTg86dQbdfQchmwN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "G5xY7qRXjax3DgMie", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 14:21:39"} {"_id": "Sj8yKSxJgjy5s5WEA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n ~(\t\t\t\t\t(Groups.Group):>Teacher) in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MCiEZysfGc3hFWoM6", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 19:51:34"} {"_id": "prpjpHo66AYdersQZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | some Teacher.(c.Groups)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LqXNyY95i99ELbhrC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:43:33"} {"_id": "KnJiDMdASs7GmdtZj", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:22:44"} {"_id": "8ur3aFhMQkNf5zsrj", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups iff {c in Theacher.Teaches}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AA5BG7ZHtPErqAdAa", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:31:19"} {"_id": "Q57FQtvuEvGjWo2yM", "cmd_i": 1, "code": "sig Name, Addr {}\nsig Book {\n addr: Name -> Addr\n }\n\npred show {}\nrun show for 3 but 1 Book", "derivationOf": "RuLQ4N2SBCrdJCWET", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-5-12 08:27:08"} {"_id": "68GwCuhYd7qsnAutD", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Q2KmYLGrwiCFkNtNZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:15:56"} {"_id": "eqzHCCztrN6DysW2n", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qs5SnowPhtKqEjPFt", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:05:32"} {"_id": "HaBBqo2nEYMEz67NJ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | (t->c + t->c1) in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone c->Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hxBP9n8pXshMqCoeL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:26:44"} {"_id": "P93yMhZmYQKykzQK5", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "m6zmG8ZQAxxseuFDS", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:53:31"} {"_id": "ZCyoGNbmp9WLrM7gb", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ytev9JeAHmDvHFKF3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:39:44"} {"_id": "XzQyNndg8cTgzWF8F", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dkQqEtYhyi7GE6c5G", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:37:59"} {"_id": "sEQNZTkD2uLMnAeTa", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "hKM4y3GifbpNWkyoR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:05:17"} {"_id": "9f8gGqBASDMD2ZRdH", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { lone c:Class | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYoj7m3sHyEKiMNY6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-13 04:02:19"} {"_id": "HndoFtQFaDmxBjXar", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MMgzvTWnbtaBdtmuH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 19:56:04"} {"_id": "YRpb4kbgHyuPn4byL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JmfpsTDmgS6xPee5d", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:31:22"} {"_id": "8CcmTENFjRqq8vr6W", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ES6KWERiXcgqgz7xM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:22:49"} {"_id": "nYTPe4da6XHSz2q2u", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "J9DmQa6CSEEv2Wyd7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:38:08"} {"_id": "xq7pmuW2zp5DqwvTt", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\tPerson - Teacher in Student\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone t:Teacher | t in c.~Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ig55qwJtEttJhEwXr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 23:56:29"} {"_id": "BDb7tgAz2GarvFc2f", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p: Person | p not in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FbCuXJFr7bPrhxDac", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 15:03:25"} {"_id": "LhLzbotBLvHCnkknY", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nf2t8sAHFH2icCfpa", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:40:03"} {"_id": "tGLawy3M4BaNgiHod", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "zMYnPC5wvFn2bWTbB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:09"} {"_id": "SPS4xHxryqdLfJfcJ", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some (t.Teaches) in c\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6XYjnJxPFf8nNQjKb", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:00:29"} {"_id": "jrqqADsGfR5f3tswG", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t : Teacher | #(c & t.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K6cNqrasmkL8kgdWj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:30:36"} {"_id": "kN2ain4ThRY2ZdeiL", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ynqm3kEAhYgbi2mnP", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-30 01:19:08"} {"_id": "S73HR8qsqeLmYSRcw", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t, s : Person | t.Teaches & s.Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "4N2TFZx89P2uPqBbZ", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:03:20"} {"_id": "c79tmcKtPWccCc3Xg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher -> Student\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c: Class, p: c.Groups.Group, t: Teacher & Teaches.c | p -> t in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6agtRQeYuvsgmYvP4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:12:20"} {"_id": "tsJNRmbosN7Tx6wdW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tTeaches.Groups.Group.Person in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "v8vBvuikJBBH23q3E", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-4 16:03:32"} {"_id": "BPdwmDGTcM8TWPGwj", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and some Teacher.Teaches implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5yYFptTSsK2pz6r2g", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:22:04"} {"_id": "dNcqQYbi2gKvkWokn", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class , c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zebvxapGjLTXoYpBi", "msg": "There are 3 possible tokens that can appear here:\n, : =", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:43:09"} {"_id": "mdKH9HMCx2JZoJhPp", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "tKAcQHTnqNrzArvSj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:05:34"} {"_id": "eX4PLCEwMjkaPGuaA", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups)) \n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "fNHjiQv4LN6iehLyg", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 00:34:19"} {"_id": "NEQ9cZ6D7jxmKW5oN", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~Teaches.Teaches & Teacher->Teacher in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YQNZM4sGbJ36x42gz", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Class->this/Class}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:45:31"} {"_id": "NhLfYQyGa9HQpdCta", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3D4DinkdCggsg24uo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:27"} {"_id": "EjptoagvWDuAxcnsA", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher.Teaches).(Teacher.Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Qn9J2bdBGmhZPhxpz", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:31:31"} {"_id": "MJm5puAiLmeX6aLvp", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oXxN9B6sFAu2me8xa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-13 18:11:21"} {"_id": "jBDecqaY8CLaFE7SN", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone((c.~Teaches) & Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (c.Groups) ) implies some (( c.~Teaches) & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some ( p.^(~Tutors) & Teacher)\n \n}", "derivationOf": "ss8jhQjDFaNniCfq8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:59:28"} {"_id": "NanbPd3e8kJ3ZmDuS", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "swwMazYa9NytYRD7m", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:29:17"} {"_id": "FB494ht2Xwen96f7Z", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teacher.Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "5DngTmPe6sWWDk8r3", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:56:32"} {"_id": "pgpq4qwGYRPNjQz9N", "cmd_i": 1, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location {}\nsome sig Name {}\n\n\npred noSameOriginAndDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\n\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\nfun commonStops [x, y: BusLine]: set Stop { x != y => x.stop & y.stop}\nrun {\n\tdisj a, b BusLine | commonStops [a,b] }\n\npred test{ noSameOriginAndDestination and locationHasAtLeastOneStop } \n\n\n", "derivationOf": "Gt8eucurDaLSjKhbZ", "msg": "There are 1 possible tokens that can appear here:\n[", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 17:15:28"} {"_id": "NLPGoAjqrMwQY3bsJ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\nPerson.Tutors in Student and Tutors.Person in Teacher\n} \n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 { ^Tutors.Person in Teacher\n\n}", "derivationOf": "qfKjjLNcMLtx7pJeo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 21:21:11"} {"_id": "g3ZWwFdjPthYPFWyY", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6ExcqvYsnkEZ2bnnv", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:03:14"} {"_id": "znncpNLA7ANv2in9G", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \tall s:Student,c:Class | some ( s<:c.Groups ) implies no((Teacher & Teaches.c)-(Tutors.s))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g9fg5Q6kjEjWAQnQo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:59:58"} {"_id": "4Ja7brkX3Jg8ntnXG", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uemt8abkTuEKMcwqZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 11:47:57"} {"_id": "62rmCahyT7WCM86o9", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies some (Person.(c.Groups))\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "syXASZqF4DhLDcDto", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 00:01:03"} {"_id": "GQQFHX4vFXGvokdP4", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Student | some (s.^Tutors & Teacher)\n}", "derivationOf": "M6MK6SsPPuRzkFqHo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:58:33"} {"_id": "ucsYzc7QwvAJmhqR9", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "JkPmbACXZvoAZg6bQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:13:57"} {"_id": "jCqDL4evvEyCEDjs7", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p : person | p.Teaches\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x8eZsKrwvXwXjd99N", "msg": "The name \"person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 09:49:48"} {"_id": "bxh9AniniJJAtToMD", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ixzEHCasbbjdJX9yk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:20:35"} {"_id": "u2JP6zHCaNw2iZGpW", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some s:Student | all g:Group | s->g in c.Groups implies c in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bipPSbGRFySB2HG3n", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 20:08:32"} {"_id": "2KxqxWZaZBX53xTKr", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CsNFAsz26XZB6K6W8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:25:31"} {"_id": "SjrKSAxQgQ9hyjzrG", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | Class in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gjRtt2qPGdhb5cunp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 20:06:37"} {"_id": "8FuHderRqvk3hokLb", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Student | all t:Teacher.(<:s.Group) in Teaches implies t->s in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some Teacher <:(p.^~Tutors) \n}", "derivationOf": "jBbwc5a9p5qSkFfFq", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 19:00:41"} {"_id": "bTSjd36yTXrQWEMSD", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tsome t : Teacher in Class.Teaches\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8WSTqfXipbJA5Y5Fc", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 19:59:16"} {"_id": "z5Y8aQpsHoPnjPMfF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c : Class | all s : Student | some c.Groups.s \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4YgA754iJ9sHW7Dnh", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 18:06:32"} {"_id": "bavLaefyaQuD97Zzb", "cmd_i": 1, "code": "\n\nmodule formalMethods/curriculum\n\n\nsome sig Course {\n\tspecializations: some Specialization \n} \n\n\nsome sig CoreCourse in Course {} \n\nsig Specialization {}\n\n\n\nsig Student {\n \tcoreCourses: some CoreCourse,\n\tnonCoreCourses: lone Course-CoreCourse\n}\n\npred show(){}\nrun show", "derivationOf": "AaxKMjT22xDWxDpKY", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-20 02:03:50"} {"_id": "rbXrXEwh6DGyFerjd", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gsBTs9bGtrryj22Ar", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:04:02"} {"_id": "SKQePC9WW6HYoRbK3", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CkDN4qC4Nr5grjyik", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:18:18"} {"_id": "QzKGjCkoBiQF7WESS", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "wwDxLsCr4ggDscorm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:40:35"} {"_id": "titejg2AyKmGyMAja", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uPmAo2ANQAK4A54Kr", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:20:01"} {"_id": "nTz8usKQm4uS53TXy", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pJ7gFSFGwueowhpot", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 21:45:29"} {"_id": "KiHFKhW4KnneGvXid", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | Teacher in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tzwNgb9DHjzwmTSzs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:43:17"} {"_id": "GQXy8k4CpSJRuEwij", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | no Student.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CW6MkHnDGAPM5EocA", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:28:07"} {"_id": "y4uuDjQYSZCi3RuGA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | some c.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8kZmnRdE25ZzBuuTJ", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 17:55:01"} {"_id": "uHgyAtieZeFYkMqS6", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c: Class | Student in (c.Groups).Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some t:Teacher | some Person.(c.Groups) implies t in Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZZvMsMvpyiewXgbta", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:17:26"} {"_id": "ePvSQHGXpFmru3A9m", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Person | some Teacher & s.*Tutors\n}", "derivationOf": "k4NHYqgWAmp5DvWmp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:59:35"} {"_id": "sc9NpHTY5DYirgLfi", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dCoCptrLqvdX7HEq9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:24:57"} {"_id": "w8Y8CnFJPFWWZA7wS", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\nall c:Class | (some g:Group |some p:Person | c->p->g in Groups) implies Teaches.c in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Pi7rpG2waRSiMYW6A", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:48:59"} {"_id": "wk2uGXXMehqiPecuq", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person | p in Teacher && p.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zju9d4zDf3Ecw85Mo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:45:08"} {"_id": "pfXf3CbpZBxkysavf", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->g->s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GGjPYcB7CMHe9Dhgo", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Group->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 01:28:51"} {"_id": "6Zr2uv27pG3ixTwt8", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qDCabcF8Ej5YZhYbN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:03:50"} {"_id": "DWYqEdtoykBjppgWQ", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person & Student ) and (Person & Teacher))\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YQkfvYEiprGm3DuLP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:30:10"} {"_id": "2n4DmLGZoCKdPrdeA", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class| s in c.Groups.Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nhsyRKN4h2dSec5t9", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-19 23:01:34"} {"_id": "QekPn3oYT6JqNgYWS", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fTyFxaeoXAuvtYdPz", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-10 13:18:33"} {"_id": "agtk4AKJ3CbW9LNru", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WScid3xfHYHKH7qv4", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:07:47"} {"_id": "YBGr9PFdJpB7WiZfo", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rRmwQ8JDcMS3Pm5uB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 11:52:04"} {"_id": "Yy9GRPboNAeCDpnK7", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "9u5o6QRb6HmTbvHWY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:58:09"} {"_id": "46S7BYrZnGBhS4H6f", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "EHBxrNN6deroQHsaW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:35:57"} {"_id": "cdZcPaLqQpWwr9mBM", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ewJQcp2fv7oD2QJS8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:51:50"} {"_id": "y5vnsNW99LTw2cfhz", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Student or Person in Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7o3FEzQ2EnMiypuxy", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:51:09"} {"_id": "NfCE47df3ncjzTaeY", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \t\n \tlet c = ~Teaches :> Teacher | c.~c in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n\tlet t = Teacher <: Teaches | t.~t in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | #c.Groups.Teacher > 0 => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zk9aKABa7gYXJefan", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:37:53"} {"_id": "GvJDKAi9aap9MpMJh", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XzaJ3oNjrYcicknPN", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class": {"x": 282.75, "y": 199}, "Group": {"x": 282.75, "y": 298.5}, "Person": {"x": 282.75, "y": 99.5}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-23 19:37:52"} {"_id": "gXqSW7ZxR9XybF58i", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s:Person, c:Class, t:Teacher | all g:Group | c->s->g in Groups and t->c in Teaches implies t->s in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HSBceA2CMHYEgEEcp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:45:11"} {"_id": "8sNs7zmyZGrociZCC", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some g: Group | some c: Class | c->t in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iFXhTDkmn9bLkEhdq", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:10:39"} {"_id": "HxYQbvaBidJoAYLcC", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Sw4qcv5EnCJzSpq2t", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:29:47"} {"_id": "mGTXz6XoTeL88C4Bd", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | c.Groups in Class.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "opASrMph5Hr9ARvZ7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:54:32"} {"_id": "fZavrpAsbTHPhap7a", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student = Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8Dh4mc7xt8sjpMfsQ", "msg": "= can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:08:03"} {"_id": "oE36KN2DTGwT9Zb9m", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c<:Groups) and some (t<:Teaches).c implies some (t<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4sS6HiM5KyhapPTQm", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:04:51"} {"_id": "WbvJwLv8mXd58LYyP", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \tall s : Person | some Tutors^.s & Teacher\n}", "derivationOf": "Q7WP7GMnqsTSzKsAw", "msg": "There are 25 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all fun iden let lone no none one seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:51:28"} {"_id": "ap7reSv9WmFByTjGS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall t : Teacher, c : Class | t->c in Teaches => some c.Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "43Su5coBCK6SD6WFw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:56:55"} {"_id": "7gQoNq4PjkpqDBjEh", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9nMZ3ccecNE7mArZf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:55:35"} {"_id": "WghQ8eQBMsXrLMP2D", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student & no Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fZavrpAsbTHPhap7a", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:08:43"} {"_id": "dnrvipWa3bNp2vGvp", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | p not in Student and p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9WDt8KkAXKeKbrhgP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:04:46"} {"_id": "N6yNCFXgLPmkeAcTx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches >= 0 && #t.Teaches <= 1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teacher.(c.Groups) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pM3NQSCeDtSsgMyzn", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:49:51"} {"_id": "6ywMeAxLGGkCfuM96", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "wpK7h9Gt6EZ3FkDHa", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:29:52"} {"_id": "nAMYREacibQNyANwG", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tno (Class - Teacher.Teaches).Groups \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2pi23j7uJ7BbD3oLW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 16:31:39"} {"_id": "H2PoAcoeWmTRdRPp9", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno ((Person-Teacher) and (Person-Student))\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "55aF7XfyFg53avcxB", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 20:50:08"} {"_id": "JhmeAxcJMoe7dBJ2g", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F6YSMZ6iKSQApjDgR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:22:32"} {"_id": "7m2dhAAfGeQ6Td2MX", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher, c:Class | some t.(c.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | some Teacher & s.^Tutors\n}", "derivationOf": "GtbBuNwiWnpFibzKY", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-9 15:52:45"} {"_id": "9enR7mifZa9Br8sMz", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | all s : Student | s->Groups in c\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nohmsWGszo9ct5zP8", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 21:32:17"} {"_id": "ePykGYpKEcrKZkFW6", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t~Teaches.Teaches in iden and Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "T9NXdcTecgzK9XTk2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 20:41:14"} {"_id": "iiKwgQrnqpQ8cff7r", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LPKxcCiemecvYyyXH", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:37:16"} {"_id": "LSJupPa9CqpkSJX6W", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p in Teacher \n}", "derivationOf": "deyTTsMLSwG2ZSqAM", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 01:43:23"} {"_id": "MPaDHG9Q2xXoGeap6", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "ucsYzc7QwvAJmhqR9", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:16:13"} {"_id": "tR4br8PcRPEtMXPwt", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no ( (Teaches.c in Teacher) & (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "PQRx38af488KoABBZ", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 14:07:52"} {"_id": "7nEzh4fopa4AtBWH3", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\nall p:Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\nno p:Person | p in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9zfNCnQWDJ2ddHnmf", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-6-10 09:53:40"} {"_id": "AFQTvT4r5kzwAoazx", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student - Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ws7WHjY3WZvriMR2S", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:20:57"} {"_id": "65ZP3sjE8SPJ7iMLZ", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some (some (Person - c.Groups.Group)) + (some (Teaches.c))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qsK5HkfwnWAhiEdAM", "msg": "+ can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {PrimitiveBoolean}\nRight type = {PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:47:36"} {"_id": "CYfzMtBh7MApFdxD3", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n ^tutors :> Teacher\n}", "derivationOf": "5MtmBXpjvP8nsTBsN", "msg": "The name \"tutors\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:54:32"} {"_id": "MMajM3pWQjodnsusq", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher, c : Class | some s.(c.Groups) and some t.(Teaches.c) implies s.(t.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "iB8bN6KeDbBSAeD4m", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is (this/Person <: Teaches) . c (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 20:57:20"} {"_id": "x7bf6tiMtZpdKmXrg", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uFKEoyMZHdoLQqgNk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:46:55"} {"_id": "E74CMp3v6rTuDoZ9s", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gquG94JCDbkL6xGgX", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:27:52"} {"_id": "tMev7Pcqx6ofjGgcY", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno ( not Student & not Teacher )\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uvzCBTSE5tXtNKjps", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:10:11"} {"_id": "t4BjeWzqCFAykfunk", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5XyGaCTwGsotGvtWa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:55:27"} {"_id": "7xF9ZLxg5bC46J92Z", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | some c.Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GXrXhvqbpf4EPxC8T", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:41"} {"_id": "QdYC57ia7SCNXne6x", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups and p1 -> c in Teaches) implies (p1 -> p2 in Tutors) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "29tHhmxgQZj25WyRq", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 01:43:52"} {"_id": "cSREHSiMCwEsJHY9E", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | lone Teacher.(c.Groups) \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WxDoSEnKLnq6rhQ7i", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:40:35"} {"_id": "Ls5iM8HJfE87je6w3", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Person | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:person | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RDRgMQZ2SxKSFiTH8", "msg": "The name \"person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:41:12"} {"_id": "DSkgsm5hCsBAZtTYH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some g : Group c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Gzp2ALKN2PgkKEoyg", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:48:33"} {"_id": "vissWLH8otdbwCLAK", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : Class, g : Group | c->t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ni4eLHZ3dGFBAgeQC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:36:20"} {"_id": "2QGduiPWdWNFvZFY7", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) & Student in (Teacher & (Teaches . c) . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "544zbqRpFaMWnK7Pe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:52"} {"_id": "L2kZnh3t6JRWrfcG2", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | no (some Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j7ujvRSkMJJn7wPkc", "msg": "This expression failed to be typechecked line 88, column 16, filename=/tmp/alloy_heredoc17998096068749900877.als", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 14:59:36"} {"_id": "kbJptGWMREFazoLqY", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Teaches and no Tutors.Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BigpFwPzctd9LMzPh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:03:52"} {"_id": "xdvDTjFQouFnPmFKy", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "B65QwB6fxY5PZeHhw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:04:34"} {"_id": "DLiwqwpWDco56urGp", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QQHLR3M3bvbcYaWgX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:11:33"} {"_id": "HtyCvTr93Judapqft", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches >= 0 && #t.Teaches <= 1\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teacher->(c.Groups) < 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eyj77jWbKWqmT2aFW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:49:25"} {"_id": "F2cLEDuot33vChoJS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | t->c not in Teaches => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8x2HPo9WKrHdezo9J", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 12:03:00"} {"_id": "Xr5jzX2y7Q5J9yXS8", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "pZka7QjXdjptoAdt5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:39"} {"_id": "TJXPvBgM5AHwvorzS", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c: Class | no (c.Groups) or some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | ((c.Groups).Group) in ((Teaches.c).Tutors + Teacher.Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HCKhwJCnyub7WgwKS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 17:47:11"} {"_id": "pS7arGTYgs2ami8oY", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6wvAEumqFELLHudzv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 21:44:04"} {"_id": "Q8gMJAzm67fgCvCz8", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-6-6 10:16:32"} {"_id": "Nd4EcmNKNX2qbok7r", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tTeacher.Teaches in Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dKsnT5Qbcjqdvb4kf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:16:03"} {"_id": "ckYphFdKhsAqAcaai", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p : Person | p in Student and p in Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z34TndKfFSxE6dYZY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:30:57"} {"_id": "5e6EWNdebHzMxpLPj", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) & Teacher<:Teaches).c\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qywjP8BhjeNwGCnA6", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:57:34"} {"_id": "MXgFKKwYezeyBhRhw", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "agfnQm6qWoeFyq6ss", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:58:55"} {"_id": "6w7Z3hk5jfqZ6JcoE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies (some Teaches.c) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "j7id5tJSDWzRLjaqd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:56:35"} {"_id": "pZka7QjXdjptoAdt5", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "dpmyus5iWautwfLG7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:37"} {"_id": "6a6cFpEzPABH6vnDc", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher.Tutors = Person.Tutors and Tutors.Student = Tutors.Person\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bur2mN9MSXsCZ4rBr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:02:35"} {"_id": "TJHguN99XPhf3WYTY", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | (c.Groups.Group) in Person.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "4intK7GvgxQhwpuit", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:35:20"} {"_id": "Q5PPAi7eTzHdPkwxc", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall disj c: Class | \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.Tutors \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ugN6mTYWnm8gC8SPg", "msg": "There are 37 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:31:01"} {"_id": "HTcSQf9hToYcpna4v", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tPerson -> lone Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yBLhQA5eg3mcfAYmD", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:56:34"} {"_id": "8foDS43k9wQ8j9mZD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mQ65Y7f2x47Synx25", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:31:54"} {"_id": "3RqzcKcvPzPHbEYxa", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\tall c : Class, s : Student, t : Teaches.c | some g : Group | \n \t\tc->s->g in Groups && s in t.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Zqz6Qkepg2cianhMu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:52:58"} {"_id": "5xcdDSeDeiZZ5RouR", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jo2vPGMFizCZQt3Li", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:28:42"} {"_id": "dZubDiQ4xRYvsFgjj", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wbpyw6BAcM3Rk3vRE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 13:22:23"} {"_id": "sz8MmSgnbgTj5t2E9", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aMw6wxJSpispBGWsw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 13:52:13"} {"_id": "Qn9J2bdBGmhZPhxpz", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teaches.Class).(Teaches.Class) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8e9pvi4RDhxDMTFqc", "msg": "~ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:30:54"} {"_id": "H2JEg5NqKFb6esK4d", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone (Teacher <: Teaches) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n all s:Student , t:Teacher | some Tutors.s :>t in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "ZwoXCfoC6bXNAApZG", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:08:43"} {"_id": "m5K4NntxbWJxkDMN5", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t~((Groups.Group):>Teacher) in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x5zFvT2kT5zLkJTTr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:25:23"} {"_id": "ik2wwzEQLWuveGYXR", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | all t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 10:32:49"} {"_id": "gZXmfsapHEHjjAxwM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { \n \n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "PAz9GeoJQwNS8L36B", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:25:28"} {"_id": "jH8Az2rTD77LxNoaa", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | Teacher->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GykDJK6cZsE24MGwa", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 19:59:34"} {"_id": "JNpT2QgLrZRBwEyaE", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c.Groups implies (some (Teaches.c & Teacher))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c.Groups).Group in (Tutors.(Teaches.c) & Tutors.Person)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LvYdJLfvTfq83kW6P", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 17:29:26"} {"_id": "nRGfqMt9WSqWQijzd", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | (c . (Groups . Group)) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "iBCsxWHnwz84RmCRv", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:56:28"} {"_id": "rQYpsGoLxEP6ydxq9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups \n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | c.Groups in Person -> Group implies (some Teaches.c & Teacher) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6yTa6t6qB4vRaS6ym", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 17:43:37"} {"_id": "TQMRrMLt7MMBwBdp2", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n Student in (Class.Groups).Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "LKPknCaifvie95nMc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:45:10"} {"_id": "nGJwtCa7E5g8fso9f", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all s: Student , t:Teacher | t.Tutors.s\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ij5M6cDmfrBerNaqb", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Tutors) (type = {this/Person})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:41:03"} {"_id": "5Antg6jk8tccQ4x4B", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CFg9zbuKBTRDxmefu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-24 11:53:28"} {"_id": "MZQEevce98mhooXxn", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kr8XcBueWFSCMeRF6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:43:10"} {"_id": "tEij8awKjcHfNGZS5", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "u2CXFmSLLk29CtTEZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:20:41"} {"_id": "ZvcmCfPte9Qirb3zo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | t.Teaches = c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rdsHB7JHZPJ295Hay", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:49:41"} {"_id": "kTCKqgNnqdoAqfrbi", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | Teaches -> c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5BKnrtFgsBh5rN4ex", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:48:33"} {"_id": "aaub2GgpgkAAdaY3T", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall t : Teacher | some Class.Teaches\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bTSjd36yTXrQWEMSD", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 19:59:25"} {"_id": "TRJRyxAiWZZ4Ag8Df", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher{ some t.Teaches }\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9svaSkX56kLr78s5B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-12 20:40:57"} {"_id": "7yoAQqhLsccwH5TMi", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n all s : Student | some (Class . Groups) . Group\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Do5Fdj6njSDmKipFK", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:13:52"} {"_id": "y6utKm8L9C3vTL27D", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teaches.c :> Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some Teaches.c :> Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student\n \tTutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | \n \t\tsome c : Class | (s in c.Groups.Group) implies (\n \tall t : Teaches.c :> Teacher | s in t.Tutors\n )\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DizvDv2ivDhNMkt8Z", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 16:03:15"} {"_id": "8ZEMpZBLD2M6DuCPx", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t->Class)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors)->Teacher)\n}", "derivationOf": "v2PKLjcX2PhDg6JaE", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:18:14"} {"_id": "CfdDRr3kaZqBzXfET", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vLMWMkXBBDrEbY8MC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:35:02"} {"_id": "ksboE28D3cfgeoSqE", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | (c . Groups . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n all c : Class | c . (Groups . Group) in (Teaches . c . Tutors)\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "DTLnujaHNvSJqsj6B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:45:20"} {"_id": "XmigtMQhHzR8zKX2i", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class, t : Teacher | some s.(c.Groups) and some Teacher & Teaches.c implies some Tutors.t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jrwSZqKf6FtTLDGnd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:27:38"} {"_id": "SLQNs7QyBsnPHL3QA", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "My3E5oBT7ZBk5BF9q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:25:06"} {"_id": "R5zm4dfzN8WAkx2q6", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-14 00:02:54"} {"_id": "zoJEdDGRERhr5KmkZ", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall c : Class | lone c in Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wp3Mu2LKJ2dnn72A9", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 20:11:18"} {"_id": "9Q2isy5LrnPr8g6Bk", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class{ some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \tTeaches -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TjDzMCX48hMzoYPpW", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-12 20:53:41"} {"_id": "j6pKaFc2yEa3z5fhg", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | all Teacher.(c.Groups)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g3ZWwFdjPthYPFWyY", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:03:35"} {"_id": "TuHhaqn2XvZRbWE9G", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) and some Teaches.c implies (Tutors.s in ( Teacher & Teaches.c))\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HX3r7dizdTr8LwrXo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:33:41"} {"_id": "PYtuaMSesb2wPGTps", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno p: Person | p in Teacher && p in Student\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "26C6GGZAqKuP63bTJ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:01:52"} {"_id": "bZmWHPiz3Xz8tpDbX", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Person.(c.Groups) & (Teaches.c).c.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "frjGumfLYmZ65QJwJ", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Teaches) . c (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:35:11"} {"_id": "YiRaewrj3urYXmtiQ", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 20:45:13"} {"_id": "wjnQJquxczhzZhzTs", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:27:02"} {"_id": "H35HJAyZv4zqm47Pc", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n\tall t : Teacher | one Groups.Group.t \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "YyjbhKpywWW6czGkp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 23:22:22"} {"_id": "ssJqKWaSNDo6obzuJ", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oRZN3nDnJkc6xSauJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:24:06"} {"_id": "PGEJDnf3TXA6k9op2", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | no (Class -(Groups.(s->g)) )\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9EbWSHhSiZbKkDmEi", "msg": "- can be used only between 2 expressions of the same arity, or between 2 integer expressions.\nLeft type = {this/Class}\nRight type = {none->none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:27:52"} {"_id": "dpPrv6DunuKKezzmg", "cmd_i": 0, "code": "abstract sig FSObject { }\n\n\nsig File, Dir extends FSObject { }\n\n\nsig FileSystem {\n root: Dir,\n live: set FSObject,\n contents: Dir lone-> FSObject,\n parent: FSObject ->lone Dir\n}{\n \n no root.parent\n \n live = root.*contents\n \n contents in live->live\n \n parent = ~contents\n}\n\npred example { }", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "The name \"Person\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-2-26 09:33:38"} {"_id": "feDhWAN8F4YpYaggb", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "owRdDBypWk25y2S9B", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-2 17:03:38"} {"_id": "KbbhxdsXQuYmc3NRr", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nt6YvqGAXYQRMGcA3", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:34:00"} {"_id": "ktPxqjxNYukSurKH4", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tall c : Class, t1, t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rrk6rwem2RgxgiQwx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-23 18:19:07"} {"_id": "3vy9fHYoPPr34wYZ3", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CqBwq9trt2AEvBfM3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-12 18:27:08"} {"_id": "C3EXvS938hJZtsL6e", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student & Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WghQ8eQBMsXrLMP2D", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:08:50"} {"_id": "R8TxkoRNyKY6dBvjp", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-6 17:14:27"} {"_id": "BGY33YcgzM5E6qfef", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (^Tutors.p & Teacher) \n}", "derivationOf": "ebRPqLLJMqZcyvyam", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:50:32"} {"_id": "o9msPS7RcwKyu75FB", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fNSm99ZCKg7CT4z6i", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-12-8 11:57:45"} {"_id": "t92hB2v7jvhx6PFzF", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class | all t: Teaches.c | some a->t->g in Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "NB2ovano8DwpS3Qr2", "msg": "The name \"a\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:13:20"} {"_id": "Ycqw9YsA48SWEjdCj", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\nsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jDtrcDzy7AQzcPswi", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 14:39:25"} {"_id": "F4nXinZgqSPRX48F6", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | c in (Teacher<:Teaches)\n} \n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2YnbFYRRhopa9Mb4s", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 20:07:36"} {"_id": "euGFwubJRfYfMKKNd", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n\tPerson in Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \nall p : Person | p in Student implies p not in Teacher or p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FbBsHER78mJs3PoKn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-13 03:40:27"} {"_id": "GqAJbxfiWzAxNFTDC", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8CcmTENFjRqq8vr6W", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:23:34"} {"_id": "NoRty65F787tBAYQH", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class { some t:Teacher | t in c.~Teaches }\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher { lone c:Class | c in t.Teaches }\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class { lone t:Teacher | t in c.~Teaches}\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall s:Student { some g:Group | g in Class.s.Groups}\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a9foNbfGYBBtfCrx2", "msg": "This cannot be a legal relational join where\nleft hand side is this/Class (type = {this/Class})\nright hand side is s (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 04:24:58"} {"_id": "Z66xKEW9ziuAKz3uJ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "8fjXWfANHgoyNct9r", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:10:37"} {"_id": "NBJyNC2CLhrauGC7e", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Ycqw9YsA48SWEjdCj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 14:45:40"} {"_id": "cZRk9Q3m7jnwdDGMg", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GoDabTegrTR7Q7NLH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:57:11"} {"_id": "D3rzaanMkwiJe28qZ", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.(Class.Groups) and t.Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QxzSARs6r8dCZC9WA", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 18:57:25"} {"_id": "2Dhd7qqqRcJ9rXox4", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "39fEwcZnRToD4isge", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:51:47"} {"_id": "HbhfA6QTEkcR5txhp", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, p1, p2 : Person | {\n (p1->c in Teaches and c->p2->g in Groups) implies (p1->p2 in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "YvGKmuq9CpW8exzan", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 18:21:02"} {"_id": "8i8Jv59E4pMAd5p7g", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n ((~Teaches):>Teacher).(Teaches:>Teacher) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NSSpQynTokfBjRKxr", "msg": ":> is irrelevant because the result is always empty.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:46:48"} {"_id": "jBLRMzvBMtsJLZoDL", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t~Teaches . Teaches in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tTeaches . ~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s : Student,c : class | some c->s . Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hRiBxS3tSgxNnDAwY", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:32:15"} {"_id": "a94u6iMgHunQDJzFL", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class , s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "89T8TSRuLeCP9tEEM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:50:04"} {"_id": "jxdsPRCgKp7wYMw73", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : class, t : Teacher | some c.(s.Groups) and some Teches.c implies s.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "g3gm8ycv6hAeeZp6G", "msg": "The name \"class\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-23 19:23:16"} {"_id": "MHLfdCJACRtx7gXpL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies Teaches.c & Teacher\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vhxwYoccn4ucKGYbu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 14:53:55"} {"_id": "vS4pZLiKpwmFeiBsG", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xzzp4YrbA3zPPZQKX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 22:26:40"} {"_id": "v9e65mvREm6AQFybc", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = Student + Teacher,\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cNwLrrYC7jbx5DW3f", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:27:32"} {"_id": "6CdG4YG42twvxbSra", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9KGWu9oPZbcFG9zM5", "msg": "This cannot be a legal relational join where\nleft hand side is this/Teacher (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 19:22:49"} {"_id": "XXzgApZiQcH3hTEcx", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n Student in Class -> Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "c2AXewmyb7NStWFMG", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Class->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 12:20:13"} {"_id": "zLtrp9G6AL7Nb8oDK", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teaches . ~Teaches) in (Person -> Person)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "o6g2Rq5bKWgGLPJ72", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 22:04:12"} {"_id": "zSua77c6qd5TQeYc2", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.Class\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 21:16:39"} {"_id": "QATgbza96shJufnH5", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person-Student | p not in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zpxi7yuf4nn6S4jPx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-13 19:56:35"} {"_id": "D4BMkBaxnndEssBnv", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student | some s.(Class.Groups) and some Teacher<:Teaches implies some (Teacher<:Tutors).s\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JhmeAxcJMoe7dBJ2g", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 21:22:44"} {"_id": "ZgKXX64tZmGFzFf6N", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:27:47"} {"_id": "vxPziRcfnoijHbHax", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson&Student or Person&Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QRjjmrYShCPHyzpHX", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-22 20:52:47"} {"_id": "rFKSTy9XyDT6hQKKA", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n Teaches.~Teaches & Teacher->Teacher in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches.Groups.Group.Person & Teacher = Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "D7TkHpDrkgbERxK9S", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:59:57"} {"_id": "FsELDxKvLpH2iQdQ8", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { some Group.Class & Class.Teaches\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XTpmR6NyhdRpdpzTN", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:00:31"} {"_id": "NH3GZ9fYxPgedgsh3", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xtwRmeWuGZj8P5C4E", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:15:20"} {"_id": "bBuj95e8TNs6837CY", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n Teacher in Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kdginZ8AESqE5sWc9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:40:02"} {"_id": "fBtTmXfj3zSjQJmLh", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {Person in Teacher or Student \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dTkgDwc5HLfXRpnfp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:47:10"} {"_id": "jBbwKFXKy9J6sHnyd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XeZBiQPKn4a7F7BKQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 17:35:21"} {"_id": "CXB5gWvPM7u4Wg7gy", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qqNRRgB7cgep6GjBH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:54:05"} {"_id": "oAiueFn35KJb5jgbu", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all p: Person | some g: Group | all c: Class | c.Group.p implies p in Teacher\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6ZErzc3gu6xMFtwr", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:27:44"} {"_id": "LwGQTJ6TYCEEJbkPw", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Teacher & Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-11 11:29:26"} {"_id": "FmSsn4bQcs6pXWHfD", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "z5WkcvA3EANvtkZyM", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:35:31"} {"_id": "qRq8Qkr6Fqihjzf7J", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #Teacher.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R4P7W9YCitq9FNki3", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:32:24"} {"_id": "nvDX3gNZ25AYy3QRN", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NSvXFxzbR27WdXpcr", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 19:35:58"} {"_id": "f6HNybZwPFRfocGYW", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YG7q62W8EKmhJf8f8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 16:06:29"} {"_id": "48LnhHd2x2W8KKMyF", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JRgRnd94Fh4ufCgcH", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 14:46:34"} {"_id": "GKtZcwqZe6CuC3o76", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| one t:Teacher | t in Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uvbv2BQRkWiWH9qC8", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 00:43:47"} {"_id": "LLXzw4QCJTmvW4e9h", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher . Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches . Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vQ8Zw65kuRtpsv6XF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:35:13"} {"_id": "vJpCNJPr9ZfxJ555v", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class -> Groups implies Teacher -> Class\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "d8D2k8AZL3padiBjz", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:53:48"} {"_id": "P5NQYgiy86dmzk7Sj", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "wJ3fASo5F6TZ9dCvN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:36"} {"_id": "pZd2dmnCAPG2hZRXM", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass & Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t-(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tvTgJzZ7GHSAFxF9G", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:44:02"} {"_id": "ua833YtDfBtHMzv9u", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dcjHBucyswktieb6q", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 17:07:32"} {"_id": "NPWtrvoYmoNMQ3CSt", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches & Teacher\n}\n\n/* Every teacher has classes assigned. */\npred inv6 { all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches & Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { all c: Class | lone c.~Teaches & Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all s: Student, c: Class | c & s . Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "F7BsPpA8rcQRhyL5C", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Class}\nRight type = {none->none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 18:09:47"} {"_id": "ngfHQwBoccJkyxkq3", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "h2zSXNcYtaz8KNDxb", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:30:45"} {"_id": "qCZDoiBhQQQERLaKf", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) implies (Tutors.s in ( Teacher & Teaches.c)) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "bRT9sTzAaXxBQy8Qk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-23 19:35:09"} {"_id": "uGrpGe8nAm2ay7wXy", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Person -> c & Teaches)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xtzxGHQdJfwY2Rajm", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 09:55:20"} {"_id": "7LYMhYjiqMrfiCH2c", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tTeaches in Teacher some->Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gkYvPJq6aMHLmaDHB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-24 09:30:11"} {"_id": "K7M7yvuk3DcCtuRFT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#(Teaches.c & Teacher) > 0) implies (#c.Groups > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ABAe37m5QfZ8WgZzC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:18:43"} {"_id": "TeDH5QDXyCWjDukyF", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (some c.Groups) implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3tP8ys4qQtgGfnoNC", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:50:08"} {"_id": "3tjBNwQNGSL3862zM", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | (some c : Class| (c -> t))\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Anw8xmanfZKjGvYSu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:32:04"} {"_id": "fvRfJsHgpoKT3JF9G", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c & Teaches) < 2 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher, c : t.Teaches | some c->Person->Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QLi4tKrDLrexBbzuB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:07:24"} {"_id": "Sw7KG7kDP5AR8bwCx", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | some t : Teacher | \n \t\tt->c in Teaches => (some p : Person, g : Group | c->p->g in Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : Teacher, s : Student | t not in p.Tutors and t in Tutors.p\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TGuwxzmBWjRzj3gn3", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 01:40:55"} {"_id": "emsuSFJCjwGgGpKkw", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some Teaches.c => some c.Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p->t in Tutors => p in Teacher && t in Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6bgW6TghsXibYMMuh", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:20:26"} {"_id": "ZqeG6i8n2mXaonRur", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher and all t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5MwA5NJNsA28ebfPp", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:53:57"} {"_id": "wnyCmxkxh67aPuEsw", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tStudent = Person\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a7jSTDexWorbf9K8y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 13:18:52"} {"_id": "agziM642WbcFJzbTf", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p:Teacher | p.Teaches + Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DSYJFqNxyXoTz5j2e", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:18:25"} {"_id": "FTFn8Xd4Z4Yi9tZyi", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all s : Student, c : Class | (c -> s) <: Groups implies (Teaches . c) -> s in Tutors\n} \n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some Teacher <: (^ Tutors) . p\n}", "derivationOf": "CmWdnwCr4e8yhZYwk", "msg": "This must be a unary set, but instead it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:40:04"} {"_id": "NPYAXoceGJwshLZh3", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | lone Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "P93yMhZmYQKykzQK5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:53:56"} {"_id": "r8WHppv2nnch5QsRQ", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n lone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teaches.c & Teacher \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zmfEQiuxDCekfTvMd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:30:23"} {"_id": "mRC2962o5HMdK8q4L", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FvrDiYGbKMN8FgNDj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 09:14:48"} {"_id": "P5ZnJBML2RXv2gKoj", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { Person in (Teacher or Student) \n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "tPQYDMTYLAeT3Ndmc", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:47:26"} {"_id": "ryRPYD4LZi77TaY83", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fwYTEv7MqsjNKd8jJ", "msg": "There are 28 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 09:44:31"} {"_id": "G6LuzWxS5Fc49gwio", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | c.Grouops in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teacher.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xo2bgPjNtEpp8RBC2", "msg": "The name \"Grouops\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:28:12"} {"_id": "wP3XGTWPSBoiGjNMw", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mQX5TCaQSxd59asqJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 22:35:27"} {"_id": "pSktM8cWS8nzofxpr", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | one p.^Tutors & Teacher\n}", "derivationOf": "WPr7s3pANWWDE4sdX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:17:09"} {"_id": "FF2KGAvJFaPbXDFez", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t <: Class.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7q5xS2fXTAhXzAhu8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:16:49"} {"_id": "TkZurGRxHHhHinnrc", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eJnk3XvKC5LdM6esx", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 22:52:20"} {"_id": "CfbGYAccKBn3Xcnkn", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JvfCESGuPc4LciDXH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 09:12:44"} {"_id": "kBPyg5dS8ehZFjBqX", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t . Teaches <: (Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Teacher <: Tutors = Tutors && Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (c . Groups) . Group in (Teaches . c) . Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Teacher | some p <: ^ Tutors\n}", "derivationOf": "TeZvba8pDFPyncP8Q", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:34:29"} {"_id": "KnArwsMApmJKnooDg", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | lone (Student.(c.Groups) & Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "Yd9q9CeZQT66GFw33", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:39:14"} {"_id": "DPMXHTHx65XkcBCMC", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tsome c:Class| some Teaches.c + Teacher and some c.Groups \n\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "jJBxcvWZGdv4hkeAK", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 22:25:38"} {"_id": "zKr8rWFM2hd2tffTr", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2Dhd7qqqRcJ9rXox4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:51:57"} {"_id": "Tjx75WaFmozg4Y2jT", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Person | some Teacher & ^Tutors.s\n}", "derivationOf": "ePvSQHGXpFmru3A9m", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 11:00:00"} {"_id": "PHC8mzWA8og3BZKhj", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CLCxDLz8K2Zx2LSK8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:06:16"} {"_id": "nnyLmWECCgGfao2MD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all x : Class | (some y : Person, z : Group | x->y->z in Groups) implies some v : Teacher | v->x in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "gLcAMYi7H8d4N7FEB", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-14 09:51:33"} {"_id": "ZSB2MxF85jhBSS6nn", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XDjbcd4GdwiDBR67R", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Teaches) . this/Class (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:34:44"} {"_id": "9GCoZQJg9nMf9ihuH", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AYQfBWQt7spLhTX7H", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:44:22"} {"_id": "jSWugJwXyfJxGZut7", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tTeaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3FhqcuC9WGdX86uLo", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:25:28"} {"_id": "nNFewAmdpQft8dWmo", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | (some g:Group |some p:Person | c->p->g in Groups) implies Teaches.c in Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "syAgRaZTkn4GoszTj", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:50:26"} {"_id": "8R6twhRrDqcaz5YjR", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hr6XmG8mKs9EWigeQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:22:14"} {"_id": "Dys2qRhTNeSeNXSyw", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\t\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \tlone ((Teacher <: Teaches) & Person) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall c:Class |all s:Student | some (s <: c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t \t\n\tall s:Student ,c:Class | some (s <:c.Groups) implies no((Teacher & Teaches.c) - (Tutors.s) )\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s:Person |some (^Tutors.s & Teacher) \n}", "derivationOf": "Riv5eZnvX2e4QNFEk", "msg": "& can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:13:38"} {"_id": "zsDfkEzsqLy8gW5Mv", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher in Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9sLgLNzLW7tgSrTu6", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-4 07:32:02"} {"_id": "gn6r3NZvNWDTtFq3a", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone((c.~Teaches) & Teacher)\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some (c.Group) ) implies some (( c.~Teaches) & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "2WhrggwkvjS5sgaAp", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-18 17:53:10"} {"_id": "g5ZDb8mGmtBHzK4d5", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n (Groups.Group).~(Groups.Group) in iden\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5sBERss9fae5cMdzc", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 22:53:28"} {"_id": "EPDxEtis6MAL8ePJE", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Class.~Teaches&Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches&Teacher\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {all t:Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {all c:Class | lone c.~Teaches&Teacher\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FxsutXcMHAMLPhyaS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-8 16:56:13"} {"_id": "A6zwfk789v9DHqsKX", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some p : Person | no Teaches.c => c->p->Group in Groups\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aZqqLWcNcWFaQKffe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 22:04:11"} {"_id": "5R6Eha387fneqnSDX", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in (Class.Groups) and Class in (Teacher<:Teaches) implies Student in (Teacher<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BCptAY5PkmhXBvijY", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:17:25"} {"_id": "CThx3CgK752uDsPhr", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher & Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups implies some (Teacher & Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t: Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors.Person in Teacher and Person.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \tall c: Class | Teaches.c->c.Groups.Group in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p: Person | some Teacher & p.^Tutors\n}", "derivationOf": "Pd7YFSLXvy3bjRsWz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-10 23:09:39"} {"_id": "fs2znQpk2dwmRyjqM", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "cXukkCEuvQHy4Wcef", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:53:45"} {"_id": "3kZBqLHNAeqhqfpWX", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "eHYLgNF2ZmZWBBJD2", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:30"} {"_id": "uQ2BpqrJGtbA4uH9K", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Group iff some t:Teacher | c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mFjdw4zANtmSWoy7Z", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:28:48"} {"_id": "6wbqrKDuNYkpp6PTh", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | lone Student.(c.Groups)\n\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "joKQeJ9zXPmncaB63", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:24:23"} {"_id": "ckt8yAKXto7569456", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n no c : Class | #(Teacher & Teaches.c) > 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ks9wBvZyR23wozW5M", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-8 16:25:39"} {"_id": "Xnh5CRrmej6nMbdDN", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some s.(c.Groups) implies (Tutors.s in Teaches.c)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TFBzzAidvkpGethBw", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-2 17:26:23"} {"_id": "WbnvFF895Gg7auQKE", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tTeacher <: Teaches in Teacher -> lone Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone Teacher :> Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class, s: Student | some c.Groups[s]\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c: Class | some c.Groups => some Teacher <: Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \tall t: Teacher | some t.Tutors\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4jiGAkKtizYKSyjgY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 17:08:14"} {"_id": "3J5ia2EDgKBjaDE2F", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tone Teaches.Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RksEWRxixABCNGfhv", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:39:17"} {"_id": "X8jPpzyovoemXvBEx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone (Teacher->c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ijXHuGkSR747SuiP5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:26:28"} {"_id": "ZrB9smmPRLQeZGtuh", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qMfiBht5iecAFkjKk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 13:57:51"} {"_id": "Z3fjF2viRMNu8NgyM", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher | some t.Teaches in c implies some c.Groups.Group \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GKuEC27C83mWPBTgq", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:53:47"} {"_id": "7ChKdZB2zZujNHyus", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-20 19:34:35"} {"_id": "pfMKgKQdDBfMp4T5d", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlet R = Teacher <: Teaches | ~R.R in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tlet R = Teacher <: Teaches | R.~R in iden \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tTeacher in Teaches.Groups.Group.Person\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTeacher <: Tutors :> Student = Tutors\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nQswSrqH2dGGnwBDL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 16:08:18"} {"_id": "4cTKXoMF6KdaWsPwB", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "FWq2CLczcAFwnQEQN", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 15:01:00"} {"_id": "MPBksuumXYQdnbdwR", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p:Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n all p:Person | p not in Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n all p:Person | p in Teacher implies p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p:Person | p in Teacher or p in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some c:Class, t:Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some c:Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c:Class | some t:Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t:Teacher, c1,c2:Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all t1,t2:Teacher, c:Class | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c:Class, s:Student | some g:Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c:Class | some p:Person | some g:Group c->p->g in Groups implies some t:Teacher | t->c in \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kRofHXMLDs2hM6DHj", "msg": "There are 3 possible tokens that can appear here:\n, { |", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-29 10:08:55"} {"_id": "MDETKLEvRWXTxFGBK", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c :> Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zJX2dsAkMLSNdSWr4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-2 15:14:25"} {"_id": "QgBSNf5GATxgTR8xp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | (#c.Groups) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Dnw3BJjN6bAvGhFA7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:33:29"} {"_id": "86SMGppHpFTpxknYX", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some c.(t.Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SaRWGt3MpiMsX5wzF", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is t . (this/Person <: Teaches) (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-15 21:00:13"} {"_id": "dGKMbQthyoXDNz9BA", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n \t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #(t.Teaches) > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tno Student.Tutors and (all p : Person.Tutors | p in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "EGp8GySyFfzMsecrq", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 18:05:45"} {"_id": "QzqPXSrLgva7hT3zd", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gP955NN7S43Ce5Wsb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:01:51"} {"_id": "YzKqEnWrWMr4kDfvb", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person=Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person=Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall x:Class| some Teaches.x\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \tall t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5YvPf9gkwwA3DP7yF", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 470.6000061035156, "y": 159.35999755859376}, "Class1": {"x": 235.3000030517578, "y": 239.03999633789064}, "Class2": {"x": 0, "y": 0}, "Group0": {"x": 235.3000030517578, "y": 318.7199951171875}, "Group1": {"x": 470.6000061035156, "y": 318.7199951171875}, "Group2": {"x": 705.9000091552734, "y": 318.7199951171875}, "Person0": {"x": 470.6000061035156, "y": 239.03999633789064}, "Person1": {"x": 470.6000061035156, "y": 79.67999877929688}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-5 10:05:11"} {"_id": "YqQib3J7L5KLWFSix", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall c:Class,t:Teacher | some t.Teaches implies some c.Groups.Group \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mzP4zyEtm5zwBk7Qm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-13 18:52:55"} {"_id": "mnmMdTjK3KKCcj58n", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n \tall c:Class | all c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n\tall t: Teacher | some t.Teaches.Groups \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "fcMCyuQBtAL6KkFri", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 22:39:55"} {"_id": "XqKu5ySAK7obhL2kz", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xnnk7cdzDPdm3pnCw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 15:37:23"} {"_id": "s2Mk9nP9y8qQyS2Cp", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | one (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class,s: Student | some s.c.Groups\n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "f9BP4mSD2KEFMk6hs", "msg": "This cannot be a legal relational join where\nleft hand side is s (type = {this/Person})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-12 23:37:10"} {"_id": "WRygDs8ues6kdTxZB", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {all t:Teacher, s:Student | p->s in Tutors\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eHRiqya8qz35krz9N", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:12:25"} {"_id": "fH5nWkSMmG5f9dJgM", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8JTqXC4EcYeZGh5pN", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-7 19:43:44"} {"_id": "K4uykX82oSN2NWbNj", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class | #Student.(c.Groups) > 0\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qxmqat3yW36BjGRtz", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 17:54:53"} {"_id": "T7acgqjTpuL8gx4Aq", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (p.*Tutors) in Teacher \n}", "derivationOf": "sQsrEAPjSKy8J74pA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:12:39"} {"_id": "r76rnTrrwCNcrnL3Z", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one t : Teacher | c in t.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SbgfWkbs7guk836zW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 10:13:13"} {"_id": "M47QETyn7WrLHkFYu", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n all p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n all p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\nall p : Person {\n (p in Student implies p not in Teacher)\n or\n (p in Teacher implies p not in Student)\n }\n}\n \n/* No person is neither a student nor a teacher. */\npred inv4 {\n all p: Person | (p in Teacher) or (p in Student)\n\n}\n\n\npred inv5 {\n some t : Teacher, c : Class |\n t->c in Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some t : Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all c1,c2 : Class | all t : Teacher | t->c1 in Teaches and t->c2 in Teaches implies c1=c2 \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some g : Group | some t, p : Person | (c->p->g in Groups) implies (t->c in Teaches and t in Teacher)\n \n}\n\n/* Each teacher is responsible for some groups. */ \npred inv12 {\n all t : Teacher, c : Class | some g : Group, p : Person | p in Group implies t->c in Teaches\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | (p1->p2 in Tutors) implies (p1 in Teacher and p2 in Student)\n\n}\n\n\npred inv14 {\n\tall c : Class , s, t : Person | all g : Group | \n ((c->s->g in Groups) and (t->c in Teaches)) implies t->s in Tutors\n\n}\n\n\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:20:30"} {"_id": "s3aQehPxpj8sJhvEw", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tTeacher.Teaches & Teacher in Class\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher.Teaches in Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hn36AbMgDKmtmyTLe", "msg": "& is irrelevant because the two subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:22:52"} {"_id": "a8khpAJMXFHPHumJs", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "3p55MMfhqr8jjFQHr", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 15:19:51"} {"_id": "tSPpZzxx3PMQHcpXE", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Wqc7xBpBSHmETiqrR", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-1-8 20:49:36"} {"_id": "vhxwYoccn4ucKGYbu", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class| lone Teaches.c & Teacher\n}\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies Teacher in Teaches.c\n }\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DEoN9fvn9KpBoC6ki", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-25 14:53:43"} {"_id": "oXZq8Km6Sv4CWGg3y", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall Class.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DCPe5ph5cHcDiTGMd", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-25 00:18:28"} {"_id": "BRFi9MQvjCSS5YN4J", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tlone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pEnharKpeauHKmMKg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:06:14"} {"_id": "Few4XEotBTw63KDky", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HtnubqExwpquHxi4M", "msg": "The name \"teaches\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:09:52"} {"_id": "9kuLaratwkghWpXMh", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some c : t.Teaches | some c.Groups \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aYxnzcgxNuiLRptzF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 22:15:01"} {"_id": "gMPFC6yP5fGsHX2tP", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher->c) in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "LpsAku3FN3wEMLjSX", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 21:00:06"} {"_id": "bGW2AWaoq9mLtW9mJ", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student | Teacher in s.^Tutors\n}", "derivationOf": "Cgg7MTwM7tYxHnZSb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:45"} {"_id": "62WqtcMWjRtZNsH4F", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | ((c . Groups) . Group) & Student = Student\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "JA3cLC6aY6iiZYyy3", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:20:53"} {"_id": "YL2iPbb6uWGFPtF4t", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, t : Teacher | some s.(Class.Groups) implies some t<:Teaches).Class\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "aMEn9S2SvpmcDY5ED", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 11:58:10"} {"_id": "uRcrPHAYCiqdJgavE", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies some (Person.(c.Groups))\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "auq9pxCaSvZrNeFci", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:01:11"} {"_id": "8dXGgsJS2FRwb59nZ", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all s: Student | one g : Group | s->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GSmhHsdxm3d2NTP73", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 18:24:23"} {"_id": "qjsNjJWfMzxoouJEF", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | (Teaches.c & Teacher) -> (c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (^Tutors.p & Teacher) \n}", "derivationOf": "obmzw9DYLEzukvRYs", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 08:47:49"} {"_id": "DMbpgEm4d6yipquba", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tClass->Student in Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | no (Teacher <: Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3tACFcFLKJyGAC6RM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-30 23:27:17"} {"_id": "9KJiBtWRrYroMk66A", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | c.Groups.Group.Student in (c.Groups.Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t(Tutors.Person in Teacher) and (Person.Tutors in Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "HQ8TTajtTj2kPC3mZ", "msg": "This cannot be a legal relational join where\nleft hand side is c . (this/Class <: Groups) . this/Group (type = {this/Person})\nright hand side is this/Student (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-2 15:37:34"} {"_id": "Z38qu43242Zvyb7Yc", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RjEFDcegZwAfRxfWo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:31:30"} {"_id": "2szGiiJALjLPg8kro", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some (Teacher<:Teaches).c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t<:(Teaches.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher <: Tutors :> Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s : Student, c : Class | some (Teacher<:Teaches).c implies some s.(Teacher<:Tutors)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8uK8ERaL57MSZ7QYt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 12:03:03"} {"_id": "NjoPJTQY4zTQKpB2R", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome t:Teacher | some t.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class | all s:Student | some g:Group | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class|some c.Groups implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Groups | t->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MR7J5L8RXLWzjxtof", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class->this/Person->this/Group}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-13 20:09:54"} {"_id": "4XE9KzvRWK7TaMHDp", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | some (p.(^Tutors).Teacher)\n}", "derivationOf": "EntSb8hRXNXj4zJy4", "msg": "This cannot be a legal relational join where\nleft hand side is p . ^ (this/Person <: Tutors) (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 20:25:05"} {"_id": "pQqRqrRcnnyNuoBc9", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t lone Class in Teacher.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MZQEevce98mhooXxn", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:44:32"} {"_id": "GjhRaFCg576RwK4xX", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \t(Person & Student) and (Person & Teacher) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c2Hm7AArTpK9ytdR5", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:35:37"} {"_id": "kCPwdJHYRXvN3MFuc", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some Teacher & s.+Tutors\n}", "derivationOf": "q24kqjoJhfpP9B5xt", "msg": "There are 22 possible tokens that can appear here:\n( * @ Int NAME NUMBER STRING String Time ^ disj fun iden int none pred seq sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:59:34"} {"_id": "izMM8Cjro6cZQ8xCX", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tPerson not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "LuCXTBnBz6fYHiDR9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 17:53:41"} {"_id": "kQNF6SMmePhmTmHJq", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches) & ((Groups.Person).Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "tNkt2Gm5mnf8rjDfY", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:03:06"} {"_id": "QkimgrY2hKguX4gHG", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeacher.Teaches = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone Teaches.Class \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sjFdFY3KuNjNr7RWu", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:21:56"} {"_id": "zvgDe7bDFqzetkCKb", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person, c:Class|some g :Group |c->p->g in Groups implies some t:Teacher| t->c in Teaches \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "bt2aK29kqbD6xXGHG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 19:11:14"} {"_id": "kKsYgi8mt5ahXZhbv", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YBnprxNzs7hw6PEG5", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:28:31"} {"_id": "Pac7AgNLjCqumczE5", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { \n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n} \n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ahHEhmtxzbrPmc2f6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-5 11:56:42"} {"_id": "Hsta4CZd3yDLGjx4a", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tiden in ~Teaches.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fTCdb8iKqqacEwLrs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-30 01:20:54"} {"_id": "dkwW96x6FNCbCotQ8", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n }\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | not no t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all p: Person | some g: Group | all c: Class | p in Teacher c->p->g in Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fro6KyNJBBFWy2AZZ", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 16:26:13"} {"_id": "9rD6gpKZ9bNqt2DAW", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { all p: Person | p in Student implies no p in Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hG5RzHjnScfa98vxy", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:45:39"} {"_id": "NDWqeiTsuN6JPt7s2", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ((t.Teaches) & ((Groups.Person).Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "Boss77mnyLxTAN8Ww", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:05:30"} {"_id": "HWBw9JmKK8Xj7TXCy", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n some Teaches.Class.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pgetXzessfhCeyt7x", "msg": "This cannot be a legal relational join where\nleft hand side is (this/Person <: Teaches) . this/Class (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:17:48"} {"_id": "WmufmFNLHYB3dQhLL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "c9baqwNL4Pr79iC4X", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-9-12 16:58:36"} {"_id": "Pz8XENZxEcuxfFAyP", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "waNcSLurop3jAKwbo", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:08:50"} {"_id": "yC68B8Eru82s5ELMk", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c : Class, s : Student | some s.(c.Group)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "This cannot be a legal relational join where\nleft hand side is c (type = {this/Class})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:47:40"} {"_id": "Fd3W6isrjFcvDRqnD", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "3sLQhp8wBzXY4NxAn", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:48:46"} {"_id": "zz8CGDtc8nPuLd48o", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { no Student or Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ACKszbvG5DWMFhFTg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 16:46:39"} {"_id": "u2CXFmSLLk29CtTEZ", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student \n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeaches.Class = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tTeaches.Teacher = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HAFPAXwtsqsggHDqK", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:20:14"} {"_id": "u4aF5xJwrbBhk8MTo", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "qRq8Qkr6Fqihjzf7J", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-29 09:32:31"} {"_id": "4jnRjWnZy2NetyrTT", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "K7M7yvuk3DcCtuRFT", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:19:32"} {"_id": "WA7DxowFuos9nhaPi", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches \n \t\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \tTeacher in Teaches.Class \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class,p:Teacher | lone Teaches.c and lone p.Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n \t\n\tall s:Student,c:Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class,t:Teacher | c.Groups|t.Teaches = c \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZvcmCfPte9Qirb3zo", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-13 18:49:58"} {"_id": "Gm9zQmxPZfz888mKS", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (c.Groups in Teacher.Teaches.Groups)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 16:19:05"} {"_id": "ynp7YY5mAcw9n3jnB", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c && Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4vyJDYugQYH8QGmFp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:17:08"} {"_id": "hHCngteWcsFHmRAM9", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | c.Groups.s\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "njz7nCjwWEui9vRKn", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:48:15"} {"_id": "o6W6MNdApThutGkfz", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-3-22 18:15:30"} {"_id": "2md8tPxS6q7NjzcQx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches \n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #(t.Teaches) < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c in Teaches implies t1->c not in Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c -> s -> g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "x7bf6tiMtZpdKmXrg", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:51:17"} {"_id": "xDHyndqZMParRxJBc", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n} \n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(Teacher->c) <= 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person | p.Tutors in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Z22xom6QxbGqrysjA", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:59:24"} {"_id": "eNpWEspwiLifMnfPk", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s:Person,c:Class | (some c<:Groups.s) implies (all t:Person | some Teaches.c:>t implies Tutors.s:>t)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "am9YaSfZY3tY8Sayg", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 22:19:44"} {"_id": "ro9FKwKxjQc2XeD5E", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {all s: Student , c: Class | s in (c.Groups).Group implies (Teaches.c & Teacher) in Tutors.s\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yA9v4cTYRFLMSMyRR", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-19 23:01:04"} {"_id": "9nqWAmtWpCaprEPyT", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tStudent in Student.(Class.Groups) and Class in (Teacher<:Teaches).Class implies Student in (Teacher<:Tutors).Student\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5LwPeGyXDG2FHPCfy", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:19:21"} {"_id": "z34TndKfFSxE6dYZY", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "eZ4WQJ8iX2SFKmrS4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-11 11:30:40"} {"_id": "uZY9fHPFpPfeb9kbs", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tsome t : Teacher | lone t.Teaches & Class\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9wt6vovBeTyyCTjQf", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 21:02:14"} {"_id": "CQA3NZLNot8H8FKbL", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson not in Student and Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nHRheKTwEq6AWhpRe", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:10:49"} {"_id": "am9YaSfZY3tY8Sayg", "cmd_c": true, "cmd_i": 12, "cmd_n": "inv13OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n \tall t,s:Person | some Tutors.s:>t implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "enJzgXF9FY4yprStk", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 21:50:16"} {"_id": "p586iK3QHuxRYWu7C", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-16 03:19:51"} {"_id": "XYwYPvRZHSXf5aq4H", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Student - Teacher) - (Teacher - Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3bLp27QwiqinyZvJs", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:54:17"} {"_id": "262Coay38bsEAK9Ep", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some Teaches.c\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "vCGdgfEf4Dq7gcKBQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 17:52:10"} {"_id": "e9WafZprNF6xJ7CPp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\nall p : Person | p in Teacher implies some p.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\nall p : Person | p in Teacher implies lone p.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7mbdJ3ijpkFFXwqz2", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-19 18:33:47"} {"_id": "BNLqpadNHgjefEEw4", "cmd_i": 2, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p: Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Person = no (Student + Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p: Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c: Class | some t: Teacher | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c: Class | some t: Teacher | t->c in Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t: Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c: Class | lone t: Teacher | t->c in Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c: Class | all s: Student | some g: Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nz75z6C9CSBNYcuhn", "msg": "There are 29 possible tokens that can appear here:\n# ( * @ Int NAME NUMBER STRING String Time ^ all disj fun iden int let lone no none one pred seq some sum this univ { ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 22:26:18"} {"_id": "fTySK93MGHYGeNKM8", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XKCLx5bZCdkduCjt4", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:15:49"} {"_id": "c9baqwNL4Pr79iC4X", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\t\n \t no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sCTrMTwRWQ5YGzGXd", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-9-12 16:58:28"} {"_id": "H97qhWqfwqik54zfC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\t\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #(c & Teacher.Teaches) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "jrqqADsGfR5f3tswG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-29 09:31:35"} {"_id": "RirLaPMDoMAumx53u", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & Teacher->Teacher in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CNB4Bf77gMeButBtp", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:43:07"} {"_id": "GkyNAoTvoPSQLSpGy", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some (Teacher.Teaches)->c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sBTp4b5sFtyFTiv6w", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 20:15:29"} {"_id": "E7hXbRFvEmZGreZ7k", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t all c:Class | some c.Groups iff some t:Teacher| c in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some g:Group | t.Tutors in g.~(Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rARSTLqqduop2DBP5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-11-14 00:02:25"} {"_id": "7DZe6KXyQRQw4n5Q3", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups.Person | s in Teaches.c.Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "hyzvBkcwpMuvosq8Z", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:30:16"} {"_id": "JRv28L838zakt6t22", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "46iBZLCrXCP9dQy49", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-28 19:55:56"} {"_id": "4hmxMCt4ChSEvge9p", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tall c : Class | some Person.(c.Groups) in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fnrG32aBspZGEPWq6", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 17:39:23"} {"_id": "r8TAF5BG6T97RRiTv", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Teacher + Student\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pqJhqa2NwRdDnT8ae", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-12-25 16:06:57"} {"_id": "D57cMDaZmtJkJgXXW", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher or Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "sGfK7xh6RjKSDe677", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:11:35"} {"_id": "ixzEHCasbbjdJX9yk", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ij9h3sBuYLd6ZJcjZ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:20:00"} {"_id": "scvp4vKPPWzXJsEgt", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {all t,s: Person | t -> s in Tutors implies (t in Teacher & s in Student) \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Kk2opWEaKfwNnMBfQ", "msg": "There are 1 possible tokens that can appear here:\n.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-14 16:15:15"} {"_id": "bDMYpo2ZEp9ERZkFC", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { Groups: Student -> Group\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZHyxnbQqv3WXw7MoA", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 22:40:09"} {"_id": "7qkttQsagLBmLjM4z", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tsome Teacher<:Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tsome Class<:Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rJ5qYoF6wpf3PDLw5", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Class}\nRight type = {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-22 21:10:54"} {"_id": "dbE3HbxqepDHFAMgY", "cmd_i": 10, "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Student.(c.Groups) & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "37xTMTuuKSXqnxLhD", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{none}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 15:20:17"} {"_id": "SJdAD4X8Tndm7xmQC", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-4 09:46:13"} {"_id": "ks9wBvZyR23wozW5M", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n no c : Class | #Teaches.c > 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "HQNae8zto8PnMw8ia", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-8 16:25:18"} {"_id": "aymRk66bHraXTCH49", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person-Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student&Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n \tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall p:Teacher | some c:Class | p->c in Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TCua2QkSzKPyZtCWj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-22 21:15:08"} {"_id": "jhbLsXPgErxMzcqe5", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, s : Student | s->c in Groups z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:21:05"} {"_id": "Eq6iBma7beQsdY34J", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "H5XRqnyn4pmuDmjsG", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-3 23:45:36"} {"_id": "by3ZX6ibo8E5vBRgt", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZXmy6E8XqzMKWryH6", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-4 15:15:27"} {"_id": "6XYjnJxPFf8nNQjKb", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall s,t : Person, c : Class | some s.(c.Groups) and some (t.Teaches)\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "86SMGppHpFTpxknYX", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-15 21:00:18"} {"_id": "99ZwxaFvGg5P5g27j", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 { Person in Teacher + Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { all t: Teacher | lone t.Class\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RxY85qoSgGMwFFNPt", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Class (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-24 12:31:57"} {"_id": "coqxws9cDGFxqEdn3", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teaches.c in Tutors.(Student.(c.Groups))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "NJ8orzkSuiG94DvHk", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person->this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 15:26:54"} {"_id": "4QmCPJAT69tciJk4P", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "oRay9fhFptL68b7sF", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:35:35"} {"_id": "srpNYKn2gBzJHmmEx", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "R4w4LBtLBg446o5mE", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:39:36"} {"_id": "MymAimuaLHgAQTu9y", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "hYKqwQgehvq7zyD5y", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-18 17:55:27"} {"_id": "nX9HAwoFxDujgLTug", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "4FamhWNc7zMXZqyz7", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:21:55"} {"_id": "7xmNdTtNb9Z3aDC5z", "cmd_c": true, "cmd_i": 1, "cmd_n": "inv2OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tsome Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fqmwj8FqhLGggSRjm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "theme": {"currentFramePosition": {}, "currentState": 0, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": []}, "nodePositions": {"Class0": {"x": 585.99609375, "y": 132.66666666666666}, "Class1": {"x": 390.6640625, "y": 132.66666666666666}, "Class2": {"x": 156.265625, "y": 265.3333333333333}, "Group0": {"x": 312.53125, "y": 265.3333333333333}, "Group1": {"x": 468.796875, "y": 265.3333333333333}, "Group2": {"x": 625.0625, "y": 265.3333333333333}, "Person": {"x": 195.33203125, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-11 12:58:13"} {"_id": "MHb2qWTYa3MTtCv2S", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | (#c.Groups > 0) and (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "62RjbcHdb4aT6ATv4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 18:18:08"} {"_id": "WPr7s3pANWWDE4sdX", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "AktXforZQ556qvMcm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 21:16:52"} {"_id": "Xi6nPe8qmJoX2BGhx", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some(c.Groups)) implies (some((c.(~Teaches) & Teacher)))\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class, g : Group, t : Teacher, s : Student | {\n ((t->c in Teaches) and (c->s->g in Groups)) implies (t->s in Tutors) \n }\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | some (p.^(~Tutors) & Teacher)\n}", "derivationOf": "7w86LtpysY4JcWWJL", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-19 09:54:41"} {"_id": "zi4GkEWZmpiTRnFE6", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tno Person - Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno Student - Teacher + Teacher - Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "adrFy4CTZTSbe8MMM", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 19:54:06"} {"_id": "kFRAo7zootSnRHsvA", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9ATvastxMvdsRBCZS", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:52:43"} {"_id": "ZboMYbgtn34LBgJBd", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tTeacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n\tTeacher in (Teaches . Class)\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t(Teacher . Teaches) = Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t(Groups . Group) = (Class -> Person)\n\n\n\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WBDBX59HdYLpWrQHu", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:47:47"} {"_id": "RnaN7W6FJe8Tb4qmf", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \tone (Teacher & Teaches.Class)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "SBtXidYhbmaXysLem", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:07:33"} {"_id": "YLHg52GQJchhXFAR9", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \tall c : Class | some (Teaches.c & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \tall c : Class | lone (Teacher & Teaches.c)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c : Class | all s: Student | some (s.(c.Groups))\n \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | some (Teacher & Teaches.c) implies (some (Person.(c.Groups))) \n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t : Teacher | some (t.(Class.Groups))\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "SxT2zTq6xvCn6e5Cm", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-13 00:10:47"} {"_id": "sj8DfjJwqZeKZc6Dd", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \tall s:Student | some g:Group | Groups.(s->g) in Class\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XqEbxiMv9KhqH5dPv", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {none->none->none}\nRight type = {this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 15:22:57"} {"_id": "ESYaNwYHBFke9PSh5", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yAJ6MZhGSmxSSiYvP", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:38:11"} {"_id": "2XhdYgQf7M6uggB7E", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DhFhC2wkigprm7PCk", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 09:52:39"} {"_id": "Ezunkzaa6Am54xd39", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\nall c: Class,s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {all c: Class | some c.Groups implies some c.~Teaches & Teacher\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {all t: Teacher | some t.Teaches.Groups\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "p7L4sF9B3Wej4NzmH", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-18 11:33:40"} {"_id": "RgyHTgMgumYW6Zgxx", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some ((t.Teaches) & ((Groups.Person).Group))\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "kQNF6SMmePhmTmHJq", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-14 10:03:25"} {"_id": "YMyKnycomtg4g3Q8F", "cmd_i": 1, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location {}\nsome sig Name {}\n\n\npred noSameOriginAndDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\n\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\nfun commonStops [x, y: BusLine]: set Stop { x != y => x.stop & y.stop}\nrun { one a, b BusLine | commonStops [a,b] }\n\npred test{ noSameOriginAndDestination and locationHasAtLeastOneStop } \n\n\n", "derivationOf": "ppG78E626prhMGzna", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 17:16:40"} {"_id": "srpKnjaQnRwjpQmYK", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "yMjCr3HBozrQnYocQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:33:44"} {"_id": "P8RjjC4yr57b8Da24", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome (Teacher & Teaches.Class)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t: Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Rk8hrtEyRkmvmw2sM", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:41:24"} {"_id": "P56W8WYWw8CYbGYtS", "cmd_c": true, "cmd_i": 2, "cmd_n": "inv3OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | p in Student or p in Teacher \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "mG7LaM5wZcmL4mGG5", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-8 19:51:17"} {"_id": "W8myzssT96auEHN8u", "cmd_i": 11, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all s : Student, c : Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups.Person.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "c3dB6nLZgev3EHG2v", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) . (this/Class <: Groups) . this/Person (type = {none})\nright hand side is this/Group (type = {this/Group})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-14 10:07:38"} {"_id": "JjMZjWbyyZCN8HMdH", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person not in Teacher and Person not in Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { Group.Person\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "8o3T86sgDbKfDw7cx", "msg": "This cannot be a legal relational join where\nleft hand side is this/Group (type = {this/Group})\nright hand side is this/Person (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-14 19:00:17"} {"_id": "bxMtAkknGa2e3FPMj", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teaches in ~((Groups.Group):>Teacher)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uvpfaA4ZRNN5cuXKt", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Group": {"x": 433.6666666666667, "y": 199}, "Person": {"x": 216.83333333333331, "y": 199}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2020-11-4 19:53:03"} {"_id": "nQHfAhMJP9q8CQThN", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n\t\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tno (Person - Student) & (Person - Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tClass in Teacher.Teaches\n\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \tall c : Class | all s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | (some c.Groups) implies some Teaches.c & Teacher\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t.Teaches).Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t all s : Person | some (Tutors.^s & Teacher)\n}", "derivationOf": "6h4NoZuoxhTEDCTo9", "msg": "^ can be used only with a binary relation.\nInstead, its possible type(s) are:\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-4 09:50:41"} {"_id": "9i85j7df8WXdrWFPg", "cmd_i": 14, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall s : Student, c : Class | some s.(c.Groups) \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Person | some(s.^Tutors & Teacher)\n)}", "derivationOf": "dwaotpWH2wN9N25kR", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:59:39"} {"_id": "32LJP37nbdTfKg6vM", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 16:55:45"} {"_id": "u82SgRxrvHmcWxgZP", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tClass->Teacher->Group in Groups\n}\n\nrun test{ inv5 and not inv5o}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ixYARnmqoLYaQyncz", "original": "zRAn69AocpkmxXZnW", "theme": {"currentFramePosition": {}, "currentlyProjectedSigs": [], "generalSettings": {"currentLayout": "breadthfirst", "metaPrimSigs": [{"parent": null, "type": "univ"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}, {"parent": "univ", "type": "Class"}, {"parent": "univ", "type": "Group"}, {"parent": "univ", "type": "Int"}, {"parent": "univ", "type": "Person"}, {"parent": "univ", "type": "String"}, {"parent": "null", "type": "univ"}, {"parent": "Int", "type": "seq/Int"}], "metaSubsetSigs": [{"parent": "Person", "type": "this/Student:Person"}, {"parent": "Person", "type": "this/Teacher:Person"}]}, "nodePositions": {"Class0": {"x": 508.4444580078125, "y": 132.66666666666666}, "Class1": {"x": 127.11111450195312, "y": 265.3333333333333}, "Class2": {"x": 254.22222900390625, "y": 265.3333333333333}, "Group0": {"x": 381.3333435058594, "y": 265.3333333333333}, "Group1": {"x": 508.4444580078125, "y": 265.3333333333333}, "Group2": {"x": 635.5555725097656, "y": 265.3333333333333}, "Person": {"x": 254.22222900390625, "y": 132.66666666666666}}, "relationSettings": {"edgeColors": [{"color": "#0074D9", "relation": "Groups"}, {"color": "#0074D9", "relation": "Teaches"}, {"color": "#0074D9", "relation": "Tutors"}], "edgeStyles": [{"edgeStyle": "solid", "relation": "Groups"}, {"edgeStyle": "solid", "relation": "Teaches"}, {"edgeStyle": "solid", "relation": "Tutors"}], "showAsArcs": [{"relation": "general", "showAsArcs": true}, {"relation": "Groups", "showAsArcs": true}, {"relation": "Teaches", "showAsArcs": true}, {"relation": "Tutors", "showAsArcs": true}, {"relation": "Person", "showAsArcs": true}, {"relation": "this/Student:Person", "showAsArcs": true}, {"relation": "this/Teacher:Person", "showAsArcs": true}, {"relation": "Class", "showAsArcs": true}, {"relation": "Group", "showAsArcs": true}], "showAsAttributes": [{"relation": "Groups", "showAsAttributes": false}, {"relation": "Teaches", "showAsAttributes": false}, {"relation": "Tutors", "showAsAttributes": false}]}, "sigSettings": {"nodeBorders": [{"border": "solid", "type": "univ"}, {"border": "inherit", "type": "Group"}, {"border": "inherit", "type": "Int"}, {"border": "inherit", "type": "this/Teacher:Person"}, {"border": "inherit", "type": "Person"}, {"border": "inherit", "type": "seq/Int"}, {"border": "inherit", "type": "Class"}, {"border": "inherit", "type": "this/Student:Person"}, {"border": "inherit", "type": "general"}], "nodeColors": [{"color": "#2ECC40", "type": "univ"}, {"color": "inherit", "type": "Group"}, {"color": "inherit", "type": "Int"}, {"color": "#01FF70", "type": "this/Teacher:Person"}, {"color": "#FFDC00", "type": "Person"}, {"color": "inherit", "type": "seq/Int"}, {"color": "inherit", "type": "Class"}, {"color": "#0074D9", "type": "this/Student:Person"}, {"color": "inherit", "type": "general"}], "nodeShapes": [{"shape": "ellipse", "type": "univ"}, {"shape": "rectangle", "type": "Group"}, {"shape": "inherit", "type": "Int"}, {"shape": "inherit", "type": "this/Teacher:Person"}, {"shape": "inherit", "type": "Person"}, {"shape": "inherit", "type": "seq/Int"}, {"shape": "hexagon", "type": "Class"}, {"shape": "inherit", "type": "this/Student:Person"}, {"shape": "inherit", "type": "general"}], "nodeVisibility": [{"type": "univ", "visibility": false}, {"type": "Int", "visibility": true}, {"type": "seq/Int", "visibility": true}, {"type": "general", "visibility": false}, {"type": "Group", "visibility": false}, {"type": "this/Teacher:Person", "visibility": false}, {"type": "Class", "visibility": false}, {"type": "this/Student:Person", "visibility": false}, {"type": "Person", "visibility": false}]}}, "time": "2019-10-3 10:06:00"} {"_id": "cjjBLAPzdhSaj9Dus", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \tall p1, p2 : Person, c : Class | (some g : Group | c -> p2 -> g in Groups) implies (p1 -> p2 in Tutors and p1 -> c in Teaches) \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some ^Tutors.p & Teacher \n}", "derivationOf": "wjrYXfBAYvn9qMyag", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 22:03:44"} {"_id": "9idANkeC3nvAvNwma", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome Teaches \n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "MHZ5EsGGvuccDBG2Y", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 14:35:12"} {"_id": "3FnML24nsMXrvtKRS", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CwBxpDkrpLQF3LwFd", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-21 15:40:52"} {"_id": "x7XA3SG2MxGky67oo", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p:Person | one g: Group | p in Student implies p->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Nwv3sjnv93inQqrd9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-21 17:27:35"} {"_id": "tKXQ3mSq3QE42hWnt", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "86mxDrX6Mxh94R8YC", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-31 02:09:17"} {"_id": "RtGhvDEkiEKEpBG2k", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Hq9oYBsKpXxfGSF7L", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 22:45:52"} {"_id": "z3kqtFQJAnTcbwaQn", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c:Class, t:Person | t->c in Teaches implies {(s->g): c.Groups | t->s in Tutors} \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "6YDzhBDbTxZvdkqcJ", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 19:47:52"} {"_id": "qRt6cvLwF9jJn4HES", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "oEkzrQQfjqRctGuzD", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-16 03:28:36"} {"_id": "anrLEMjJCjdCNtSYH", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in c.Groups.Group \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n all c : Class | Teacher in c.Groups.Group implies some Group\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n all t : Teacher | some t.Groups.Group\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "RD8MjTQwcTcbRY7ZP", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 22:08:18"} {"_id": "uwrbGNk8ou6JBvpDm", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person = Student + Teacher\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some c : Class | c in Teacher.Teaches\n \t\t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \t all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \t some (Teaches.Class & Teacher)\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "ZuHQtvYFwhDuCJCvt", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 22:47:59"} {"_id": "SKoZAEMvq8iykwN74", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all p: Person | all g : Groups | p in Student and g in c.Groups implies p->g in c.Groups \n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nsrJ87wp8LDqyuxDo", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Class->this/Person->this/Group}\nRight type = {this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:20:57"} {"_id": "2JwQXE6ykQ9XN6JXC", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p:Person | not (p in Student and p in Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p:Person | p in Student or p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t:Teacher, some c:Class | t -> c in Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "TYYYuZXiaPfM8wBDg", "msg": "There are 8 possible tokens that can appear here:\nNAME disj exh part private seq this var", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-1-8 21:22:03"} {"_id": "pfuqEQvce2Hfpp986", "cmd_i": 0, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher&Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n all (Student+Student)\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some \t\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "BYXZHJEhHmB7t8q5k", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 09:46:32"} {"_id": "bg5DqxbQ3zE6Xjocm", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group \n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n Class in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n all c : Class | lone (Teaches.c & Teacher)\n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n all c: Class | Student in Class.Groups.Group\n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "pGkZXRYLY7YJ44aYf", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-14 21:46:27"} {"_id": "owNcXgJrTot7FDfdp", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | (t->c + t->c1) in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | (t->c + t1->c) in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ZYwtDB9YNaqd78Jhm", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:27:49"} {"_id": "oc6BZNZdpeXt8Qy4p", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n all p : Person | p in Student \n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Bj4RgXRHgwpGfopKQ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-19 18:09:48"} {"_id": "8fjXWfANHgoyNct9r", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n Person in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n (Teaches.Class & Teacher) = Teacher\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n Class in Teaches.Class\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "GWuWwEhCYWiY9TfMJ", "msg": "Subset operator is redundant, because the left and right subexpressions are always disjoint.\nLeft type = {this/Class}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:10:11"} {"_id": "8jrHsm7tm6EcMRwmT", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. \npred inv4 {\n\n \tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "WAAStarYLwHemW6Ad", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:45:21"} {"_id": "DcZ8qBFRKtYf3SAaJ", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c -> s -> g in Groups\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "njYYKJvb2QNhbtAdJ", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 10:04:46"} {"_id": "5nq6i3ASZtjBFgQuB", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n \t\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n \t\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teacher & Teaches.c \n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n \t\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p : Student, c : Class | some p.(c.Groups) implies (Teacher & Teaches.c) in Tutors.p\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "AJv3DTpvaeTSiWot8", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-3 11:21:44"} {"_id": "kuExu5FHGTkbCKvhz", "cmd_i": 6, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \tall c : Class | some x : Teacher | x->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall x : Teacher | all c : Class | all d : Class | x->c in Teaches and c!=d implies x->d not in Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, s : Student | s->c in Groups z\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "2PEgKn35A5p9Ciu3d", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Class}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-5 11:21:23"} {"_id": "x6s9D5PERfZHorY43", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | lone Student.c.Groups\n\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "6wbqrKDuNYkpp6PTh", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:24:30"} {"_id": "9p5XwJWNBsqBrppxT", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n \tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno(Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person in (Teacher + Student ) \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n\tsome t:Teacher | some t.Teaches\n\n}\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some ( Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher) \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \tall c:Class | some c.Groups implies some (Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2:Person | p1.Tutors in Student and Tutors.p2 in Teacher\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall p:Person, c:Class| some t:Teacher, g:Group |t->c and c->p->g in Groups implies t->p in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\t\n}", "derivationOf": "Nb9ANhtjKpKziJrAp", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 18:55:28"} {"_id": "bMDi9HqJRHAKZkG59", "cmd_c": true, "cmd_i": 11, "cmd_n": "inv12OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some (t <: Group)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "oAp6nj7AeQfzy7mue", "msg": "<: is irrelevant because the result is always empty.\nLeft type = {this/Person}\nRight type = {this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:27:07"} {"_id": "4vyJDYugQYH8QGmFp", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c && Teaches.c in Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gL6Td3s9p4LeYwuKe", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-2 17:16:17"} {"_id": "yK6cgSmTETrt4TS6R", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tStudent = Person\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some Teaches.c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "dZubDiQ4xRYvsFgjj", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-12-25 13:25:04"} {"_id": "Fwiae39sZK5FJKxum", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - Student - Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "Cp7vQ2ruFnvvd2CBw", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 09:34:14"} {"_id": "vYxpbQJboMQvryA8B", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | (*Tutors.p) in Teacher \n}", "derivationOf": "iZDj8Lwh8M7N9pkKb", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-2 20:14:13"} {"_id": "z5WkcvA3EANvtkZyM", "cmd_i": 3, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 { all p : Person | p in Student\n\n}\n\n/* There are no teachers. */\npred inv2 { no Teacher\n \n}\n\n/* No person is both a student and a teacher. */\npred inv3 { no Student & Teacher\n\n}\n\n\npred inv4 { Person in Teacher+Student\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 { some Teacher -> Group\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {all t: Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {all c: Class | some c.~Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 { lone Teacher.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 { one Class.~Teaches\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { all c: Class | one c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 { Class.Groups implies Teacher.Teaches\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 { \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "a6GiDPhTEuPAQTmPu", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-12-8 16:33:59"} {"_id": "Do5Fdj6njSDmKipFK", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no Person - (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher <: Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t . Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | some Teacher -> c & Teaches\n} \n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone Teacher -> c & Teaches\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n all s : Student | some s <: (Class . Groups)\n} \n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | some c <: Groups implies some Teacher & Teaches.c\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "khNDcmGDYughsmEf7", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:12:51"} {"_id": "3Ko2Hhjiz9WC8ep2p", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | (some c : Class | (c -> t) not none)\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "GyDjfCi87Mqp7YP6R", "msg": "There are 1 possible tokens that can appear here:\n)", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:32:31"} {"_id": "En7kz7Yyv2naRctGP", "cmd_i": 8, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | one Person.(c.Groups) in Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "N5M5xKFbMckg7nPyL", "msg": "This must be a set or relation.\nInstead, it has the following possible type(s):\n{PrimitiveBoolean}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 18:05:16"} {"_id": "Sj7wyuiZcYwg4cydi", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall disj t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall disj c : Class | some Teaches.c & Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all disj t: Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall disj c: Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \t\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Person.Tutors & Student and\n Tutors.Person & Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "5Nqehbvq2wgL77MLw", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-1-2 17:31:54"} {"_id": "J9DmQa6CSEEv2Wyd7", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n Person in Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\t\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n no Teacher&Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n Person in Student+Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n \n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "XzQyNndg8cTgzWF8F", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-14 17:38:02"} {"_id": "ou5CErjiAKGoNw9ip", "cmd_c": true, "cmd_i": 7, "cmd_n": "inv8OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone Teacher.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "rCmaX2fa5msmBWLjN", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 23:09:17"} {"_id": "9rGALWvJh6gP6FbFh", "cmd_i": 7, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \t\n \tTeacher in Class.~Teaches\n \tTeacher & Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \t\n\t\n \tlone (Teacher & Teaches.Class)\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "r5GDgbNuvtvuEjW3T", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 02:07:47"} {"_id": "iWazdZfDpBm4GA79Z", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teaches.Class\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "kN2ain4ThRY2ZdeiL", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-30 01:19:17"} {"_id": "teZbng759n3oYcqCL", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */ \npred inv4 {\n\tPerson in Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | c in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | lone Teaches.c & Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 { \n \tall c : Class, s : Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c : Class | some c.Groups implies some Teaches.c & Teacher \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tTutors in Teacher -> Student \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 { \n \t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p : Person | some p.^Tutors & Teacher\n}", "derivationOf": "7noo3E2SRMJpzyBYu", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 21:14:12"} {"_id": "Fw3h5Fb2rkTcnuzoW", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n all c : Class | all s: Student | s->g in c.Groups \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YEXpa3mhueLuKpCyR", "msg": "The name \"g\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 17:16:37"} {"_id": "ZRQWs8HTxF6aHTZKB", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person = (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n all t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in Teacher->Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c : Class | Teaches.c -> (Class.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gZaPCwPBvv3xKgjJG", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 20:31:27"} {"_id": "KdqtqNNYBkp2Xx6Ya", "cmd_c": true, "cmd_i": 5, "cmd_n": "inv6OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n \n \n \n all p : Person | p in Student\n \n \n Person in Student\n \n}\n\n/* There are no teachers. */\npred inv2 {\n \n \n \tall p : Person | p not in Teacher\n \n \n \n no Teacher\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \n \n all p : Person | (p in Student implies p not in Teacher) or ( p in Teacher implies p not in Student) \n \n \n \n no (Teacher & Student)\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n \n all p : Person | p in Student or p in Teacher\n \n \n Person = Student + Teacher\n\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n \n \n \n \n \n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n \n \n \n\n \n \n \n \tsome Teacher.Teaches \n \n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n \n \n \n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n \n \n \n \n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n \n \n \n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n \n \n \n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n \n \n \n\n \n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n \n \n \n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n \n \n \n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n \n \n \n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n \n \n \n\n}", "derivationOf": "kBsBGaRhjxBhETCt4", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2021-1-12 19:16:29"} {"_id": "dQkPoJXdwoZPyuHTx", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all x:Class, p:Student| some g:Group | some (x.Groups).g\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "id5zG8GnsKc9kcKM6", "msg": "This variable is unused.", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-5 11:25:19"} {"_id": "WQEMP3kSQ3iFMfQHs", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome p:Person | p.Teaches\n}\t\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "7hecJ6BjstkpF9bPy", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 10:17:20"} {"_id": "oWm9mGcTERre98GrM", "cmd_i": 1, "code": "\n\n\n\n\n\nmodule formal_methods/alloy_assignment\n\n\nsome sig BusLine {\n\tname: one Name,\n\tstop: some Stop, \n\torigin: one Origin, \n\tdestination: one Destination \n}{\n\torigin != destination and \n\tstop = stop + origin + destination} \n\nsome sig Stop {\n\tlocation: one Location\t\n} \n\nsome sig Origin in Stop {}\nsome sig Destination in Stop {}\n\nsome sig Location, Name {}\n\n\npred uniqueOriginDestination(){ all x,y : BusLine | x != y => x.origin not in y.origin and x.destination not in y.destination }\n\n\npred stopMustServeAtLeastOneBusLine(){ all s: Stop | some b: BusLine | s in b.stop }\n\n\n\npred locationHasAtLeastOneStop(){ all s: Stop | some l: Location | s.location in l }\n\n\nfun commonStops(x, y: one BusLine): set Stop { set s: Stop | s = x.stop & y.stop }\n\n\npred show { noSameOriginAndDestination and stopMustServeAtLeastOneBusLine and locationHasAtLeastOneStop }\n\nrun show", "derivationOf": "BdCbCyvgwZsJz4uL8", "msg": "There are 38 possible tokens that can appear here:\n! # ( * @ Int NAME NUMBER STRING String Time ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some sum this univ { } ~", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2021-3-22 20:02:10"} {"_id": "ipPLwHNfkseb2ZuYd", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\t\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "DiosfWdiJ5aTFW5bg", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-11-8 19:29:51"} {"_id": "pA77MGS66YEoxWv4R", "cmd_i": 5, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno (Teacher & Student)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Teacher + Student)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "ugb363o9aZJXgdEX4", "msg": "The \"all x\" construct is no longer supported. If you know the range of possible values of x, consider rewriting it as \"x == set_of_all_possible_values\".", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-11-3 23:00:33"} {"_id": "3RivMFneHTvQzcfs2", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in Student || p in Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class, t : Teacher | c in t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some c : Class | c in t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher, c, c1 : Class | t->c + t->c1 in Teaches => c = c1 \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class, t, t1 : Teacher | t->c + t1->c in Teaches => t = t1 \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class, t : Teacher | no (t.Teaches).c => no c.Groups\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\t\n \tall t : Teacher | some t.Teaches.Groups\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall p : Person, t : p.Tutors | p in Teacher && t in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \t\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "YKeHLYBuDTL8hNnzg", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <: Teaches) (type = {this/Class})\nright hand side is c (type = {this/Class})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 11:59:52"} {"_id": "HiLEYJhaQf4TCQZKL", "cmd_i": 9, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n\n}\n\n/* There are no teachers. */\npred inv2 {\n Teacher = none\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n Student & Teacher = none\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Student + Teacher = Person\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | c in Teacher.Teaches\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class, disj t1,t2 : Teacher | not c in (t1.Teaches & t2.Teaches)\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n \n Student -> one Group \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "uPTsM2n6ZgsTK2WW9", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-21 18:09:11"} {"_id": "tzsv9vvNkJwd49Lg9", "cmd_c": true, "cmd_i": 6, "cmd_n": "inv7OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n all c : Class | (Teacher->c) in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n \n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n}", "derivationOf": "gMPFC6yP5fGsHX2tP", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-4 21:00:16"} {"_id": "KDje79kS9c5iMHFuv", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Person in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n Teacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n ~(Teacher <: Teaches).(Teacher <: Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n \n (Class -> Person).Groups in Groups\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n all s : Person | some (^Tutors.s & Teacher)\n}", "derivationOf": "bXDpd4bfDNZhFtbpW", "msg": "The join operation here always yields an empty set.\nLeft type = {this/Class->this/Person}\nRight type = {this/Class->this/Person->this/Group}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 12:25:53"} {"_id": "w2MjoYBwzDfuYxfbL", "cmd_i": 10, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson - Teacher in Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\t\n \tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\n\npred inv6 {\n \t\n\n \tTeacher in Class.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \t\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class {lone t:Teacher | t in c.~Teaches}\n\t\t\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class, s:Student | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \t some c.Groups iff some t:Teacher| Class in t.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "gsBvXjgE95WD5EfH2", "msg": "The name \"c\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-11-13 23:44:59"} {"_id": "5yJyJohYvE5xGDYNM", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\n}\n\n/* There are no teachers. */\npred inv2 {\n\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some c : Class | (c -> t) not none\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "3Ko2Hhjiz9WC8ep2p", "msg": "This must be a formula expression.\nInstead, it has the following possible type(s):\n{this/Class->this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-28 19:32:44"} {"_id": "H7gw2LyfnP9nSFzrG", "cmd_i": 4, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n \t\n\tno Student & Teacher\n \n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\t\n Person = Teacher + Student\n \n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some t : Teacher | t.Teacher\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "KCEg4CoZH8MxoQCbt", "msg": "This cannot be a legal relational join where\nleft hand side is t (type = {this/Person})\nright hand side is this/Teacher (type = {this/Person})", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-31 17:02:32"} {"_id": "jThQ9rQXDyRRPnBPP", "cmd_c": true, "cmd_i": 4, "cmd_n": "inv5OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zssJ6tjr8kF8wTuDB", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-2 15:05:24"} {"_id": "43Su5coBCK6SD6WFw", "cmd_c": true, "cmd_i": 9, "cmd_n": "inv10OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. \npred inv6 {\n\tall t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. \npred inv7 {\n\t\n \tClass in ~Teaches.Teacher\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. \npred inv9 {\n\t(Teacher <: Teaches).~(Teacher <: Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. \npred inv10 {\n\tsome Class->Student & Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\t\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "CX4HWGRMbi2fmFJk9", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-30 21:53:57"} {"_id": "ifsYAdqrSBxxxotgi", "cmd_i": 13, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p not in (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tall p : Person | p in (Student + Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome c : Class | c in Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n\tall c : Class | (#Teaches.c & Teacher) > 0\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | lone t.Teaches \n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | (#Teaches.c & Teacher) < 2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n\tall c : Class | (#c.Groups > 0) implies (#(Teaches.c & Teacher) > 0) \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n\t all t : Teacher | #Class.Groups->t > 0\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tPerson.Tutors in Student and Tutors.Person in Teacher\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\tall c : Class, s : c.Groups->Person | s in Teaches.c.Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "nzfjRs4zzo7hGtrQQ", "msg": "in can be used only between 2 expressions of the same arity.\nLeft type = {this/Person->this/Group->this/Person}\nRight type = {this/Person}", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2020-10-30 18:27:09"} {"_id": "CjmZFaAvq94MSB9jc", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t~(Teacher<:Teaches).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t(Teacher<:Teaches).~(Teacher<:Teaches) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\t\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s : Person | some Teacher & ^Tutors.s\n}", "derivationOf": "hNdrq4t2zSrkLbsBY", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2019-10-3 12:23:12"} {"_id": "PXDYKevunGfrRo93S", "cmd_c": true, "cmd_i": 10, "cmd_n": "inv11OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tStudent+Teacher = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some (Teaches.c & Teacher)\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone (Teaches.c & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some (c.Groups) implies some(Teaches.c & Teacher)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\t\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall p:Person | some (^Tutors.p & Teacher)\n}", "derivationOf": "b7SrEtgBaat8rTP7j", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-11-2 15:17:53"} {"_id": "aicWtbRScCfLZCxPJ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson - Student = none\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher + Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tClass = Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "QbRRqtkd5AaPmQTWQ", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-1-7 19:45:48"} {"_id": "JKNtYnSTvvjs3wR5h", "cmd_c": true, "cmd_i": 13, "cmd_n": "inv14OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n Teacher + Student = Person\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n iden & (Teacher->Teacher) in Teaches.~Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n (~Teaches:>Teacher).(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n (Teacher->Teacher) & Teaches.~Teaches in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c: Class | Student in c.Groups.Group\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n Groups.Group.Person in Teacher.Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n Teacher in Teaches.(Groups.Group.Person)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n Tutors in (Teacher->Student)\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n all c: Class | (Teaches.c & Teacher)->(c.Groups.Group & Student) in Tutors\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "fnxTSHJo2YdwofTnX", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2021-1-10 23:06:05"} {"_id": "vMsFKMpt48fnt5W85", "cmd_c": true, "cmd_i": 0, "cmd_n": "inv1OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tall p : Person | p not in Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tall p : Person | p in Student => p not in Teacher || p in Teacher => p not in Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 0, "time": "2020-10-31 01:21:05"} {"_id": "gXmom8ozxPjdPZhTQ", "cmd_c": true, "cmd_i": 8, "cmd_n": "inv9OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tall p : Person | p in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson in Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n \n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t : Teacher | #t.Teaches > 0\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \t\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t : Teacher | #t.Teaches < 2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c : Class | #Teacher.(c.Groups) = 1\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\t\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "9MAT7QTdwm3PtWfK3", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-10-28 18:03:50"} {"_id": "L6qEtq5yEF7oGThho", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Student & Teacher\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Student + Teacher\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teaches . Class & Teacher)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\t\n \tTeacher in Teaches.Class\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\t\n \tClass in Teacher . Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\t\n \t(~Teaches :>Teacher) .(Teacher<:Teaches) in iden\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\t\n \t(Teacher <: Teaches) . (~Teaches :> Teacher) in iden\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\t all s: Student, c: Class | some s.(c.Groups)\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n \n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\tall s:Student |some Teacher & s.^Teaches\n}", "derivationOf": "BeuQe8sRE4NkSA8fX", "msg": "^ (this/Person <: Teaches) is redundant since its domain and range are disjoint: {this/Person->this/Class}", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2019-10-3 10:57:06"} {"_id": "j6GTpsDG62ef7Lmz7", "cmd_i": 1, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson in Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tno Teachers\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "scrtLLEmhMXQL4br7", "msg": "The name \"Teachers\" cannot be found.", "original": "zRAn69AocpkmxXZnW", "sat": -1, "time": "2019-10-3 21:02:33"} {"_id": "grJKTd7N2AyoqSJPM", "cmd_c": true, "cmd_i": 14, "cmd_n": "inv15OK", "code": "\n\n/* The registered persons. */\nsig Person {\n /* Each person tutors a set of persons. */\n Tutors : set Person,\n /* Each person teaches a set of classes. */\n Teaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n /* Each class has a set of persons assigned to a group. */\n Groups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n no (Person-Student)\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n (Student-Teacher) = Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n no ((Person-Student)-Teacher)\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n some (Teacher.Teaches)\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some t.Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n Class in Teacher.Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | lone ((c.~Teaches) & Teacher)\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class, s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n \n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n (no (Person-Teacher).Tutors) and (no (Tutors.(Person-Student)))\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n \n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n \n all p : Person | p.^(~Tutors) in Teacher\n}", "derivationOf": "zRAn69AocpkmxXZnW", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-18 17:36:13"} {"_id": "QidfBR6fLooGtzHdt", "cmd_c": true, "cmd_i": 3, "cmd_n": "inv4OK", "code": "\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n Person = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n no Teacher\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n no (Student & Teacher)\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n \n no Student and no Teacher\n}\n\n\npred inv5 {\n some t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n all t : Teacher | some c : Class | t->c in Teaches\n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n \n all c : Class | some t : Teacher | t->c in Teaches\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n all t : Teacher, c1,c2 : Class | t->c1 in Teaches and t->c2 in Teaches implies c1=c2\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n all c : Class | all t1,t2 : Teacher | t1->c in Teaches and t2->c in Teaches implies t1=t2\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n all c : Class | all s : Student | some g : Group | c->s->g in Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n all c : Class | all g : Group, p : Person | c->p->g in Groups implies some t : Teacher | t->c in Teaches\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n \n all t: Teacher | some c: Class, g: Group, p: Person | c->p->g in Groups and t->c in Teaches\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n all p1,p2 : Person | p1->p2 in Tutors implies p1 in Teacher and p2 in Student\n}\n\n\npred inv14 {\n all ps : Person, t : Person | all c : Class, g : Group | c->ps->g in Groups and t->c in Teaches implies t->ps in Tutors\n}\n\n\npred inv15 {\n\n}", "derivationOf": "zea2ZjpLNbvWs77uY", "original": "zRAn69AocpkmxXZnW", "sat": 1, "time": "2020-11-3 22:57:42"} {"_id": "TGhu3Z3KP4x78bMXs", "cmd_i": 12, "code": "/**\n * Relational logic revision exercises based on a simple model of a \n * classroom management system.\n * \n * The model has 5 unary predicates (sets), Person, Student, Teacher,\n * Group and Class, Student and Teacher a sub-set of Person. There are \n * two binary predicates, Tutors a sub-set of Person x Person, and \n * Teaches a sub-set of Person x Teaches. There is also a ternary \n * predicate Groups, sub-set of Class x Person x Group.\n *\n * Solve the following exercises using Alloy's relational logic, which\n * extends first-order logic with:\n *\t- expression comparisons 'e1 in e2' and 'e1 = e2'\n *\t- expression multiplicity tests 'some e', 'lone e', 'no e' and 'one e'\n *\t- binary relational operators '.', '->', '&', '+', '-', ':>' and '<:' \n *\t- unary relational operators '~', '^' and '*'\n *\t- definition of relations by comprehension\n **/\n\n/* The registered persons. */\nsig Person {\n\t/* Each person tutors a set of persons. */\n\tTutors : set Person,\n\t/* Each person teaches a set of classes. */\n\tTeaches : set Class\n}\n\n/* The registered groups. */\nsig Group {}\n\n/* The registered classes. */\nsig Class {\n\t/* Each class has a set of persons assigned to a group. */\n\tGroups : Person -> Group\n}\n\n/* Some persons are teachers. */\nsig Teacher in Person {}\n\n/* Some persons are students. */\nsig Student in Person {}\n\n/* Every person is a student. */\npred inv1 {\n\tPerson = Student\n}\n\n/* There are no teachers. */\npred inv2 {\n\tTeacher = none\n}\n\n/* No person is both a student and a teacher. */\npred inv3 {\n\tno Teacher & Student\n}\n\n/* No person is neither a student nor a teacher. */\npred inv4 {\n\tPerson = Teacher+Student\n}\n\n/* There are some classes assigned to teachers. */\npred inv5 {\n\tsome Teacher.Teaches\n}\n\n/* Every teacher has classes assigned. */\npred inv6 {\n\tall t:Teacher | some t.Teaches \n}\n\n/* Every class has teachers assigned. */\npred inv7 {\n\tall c:Class | some Teacher.Teaches:>c\n}\n\n/* Teachers are assigned at most one class. */\npred inv8 {\n\tall t:Teacher | lone t.Teaches\n}\n\n/* No class has more than a teacher assigned. */\npred inv9 {\n\tall c:Class | lone Teaches.c:>Teacher\n}\n\n/* For every class, every student has a group assigned. */\npred inv10 {\n\tall c:Class,s:Student | some s <: c.Groups\n}\n\n/* A class only has groups if it has a teacher assigned. */\npred inv11 {\n\tall c:Class | some c.Groups implies (some Teacher <: Teaches.c)\n}\n\n/* Each teacher is responsible for some groups. */\npred inv12 {\n\tall t:Teacher | some t.Teaches.Class implies (some Person <: Class.Groups)\n}\n\n/* Only teachers tutor, and only students are tutored. */\npred inv13 {\n\tall t,s:Person | t->s in Tutors implies t in Teacher and s in Student\n}\n\n/* Every student in a class is at least tutored by all the teachers\n * assigned to that class. */\npred inv14 {\n\n}\n\n/* The tutoring chain of every person eventually reaches a Teacher. */\npred inv15 {\n\n}", "derivationOf": "xPN2gusS2nbbgNwGq", "msg": "This cannot be a legal relational join where\nleft hand side is t . (this/Person <